Add GitHub Runner Image Version to turbo-cache-key.json (#10887)

Add GitHub Runner Image Version to turbo-cache-key.json
This commit is contained in:
Ethan Arrowood
2023-12-01 12:39:07 -07:00
committed by GitHub
parent 0fe8c07194
commit 447c20fb99

10
utils/gen.js vendored
View File

@@ -7,9 +7,15 @@
const { writeFileSync } = require('fs');
const { join } = require('path');
const { versions, platform, arch } = process;
const { versions, platform, arch, env } = process;
const file = join(__dirname, '..', 'turbo-cache-key.json');
const node = versions.node.split('.')[0];
const str = JSON.stringify({ node, platform, arch });
const str = JSON.stringify({
node,
platform,
arch,
// the GitHub runner image version (example: "20231126.1.1")
imageVersion: env.ImageVersion ?? 'local',
});
console.log(`Generating cache key: ${str}`);
writeFileSync(file, str);