Skip to content

Commit f4a8aa6

Browse files
committed
Use ImageOS for the cache key, so it also includes the OS version
1 parent bc0f274 commit f4a8aa6

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

common.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ function findUbuntuVersion() {
5959
}
6060
}
6161

62+
export function getImageOS() {
63+
const imageOS = process.env['ImageOS']
64+
if (!imageOS) {
65+
throw new Error('The environment variable ImageOS must be set')
66+
}
67+
return imageOS
68+
}
69+
6270
export function shouldExtractInToolCache(engine, version) {
6371
return engine === 'ruby' && !isHeadVersion(version)
6472
}

dist/index.js

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ async function bundleInstall(gemfile, lockFile, platform, engine, version) {
293293
}
294294

295295
async function computeBaseKey(platform, engine, version, lockFile) {
296-
let key = `setup-ruby-bundler-cache-v2-${platform}-${engine}-${version}`
296+
let key = `setup-ruby-bundler-cache-v2-${common.getImageOS()}-${engine}-${version}`
297297

298298
if (engine !== 'jruby' && common.isHeadVersion(version)) {
299299
let revision = '';

0 commit comments

Comments
 (0)