Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cache with @actions/cache #485

Merged
merged 2 commits into from
May 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVer
// restore cache & install
let cachedKey = null
try {
cachedKey = await cache.restoreCache(paths, key, restoreKeys)
// .slice() to workaround https://github.com/actions/toolkit/issues/1377
cachedKey = await cache.restoreCache(paths.slice(), key, restoreKeys)
} catch (error) {
if (error.name === cache.ValidationError.name) {
throw error;
Expand Down Expand Up @@ -235,7 +236,7 @@ async function computeBaseKey(platform, engine, version, lockFile, cacheVersion)
const cwd = process.cwd()
const bundleWith = process.env['BUNDLE_WITH'] || ''
const bundleWithout = process.env['BUNDLE_WITHOUT'] || ''
let key = `setup-ruby-bundler-cache-v5-${common.getOSNameVersionArch()}-${engine}-${version}-wd-${cwd}-with-${bundleWith}-without-${bundleWithout}`
let key = `setup-ruby-bundler-cache-v6-${common.getOSNameVersionArch()}-${engine}-${version}-wd-${cwd}-with-${bundleWith}-without-${bundleWithout}`

if (cacheVersion !== DEFAULT_CACHE_VERSION) {
key += `-v-${cacheVersion}`
Expand Down