Skip to content

Commit

Permalink
Include working directory, $BUNDLE_WITH and $BUNDLE_WITHOUT in cache key
Browse files Browse the repository at this point in the history
* Fixes #350
* Fixes #176
  • Loading branch information
eregon committed Feb 11, 2023
1 parent bc4e585 commit f60ef1e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,14 @@ export async function bundleInstall(gemfile, lockFile, platform, engine, rubyVer
}

async function computeBaseKey(platform, engine, version, lockFile, cacheVersion) {
const cacheVersionSuffix = DEFAULT_CACHE_VERSION === cacheVersion ? '' : `-cachever:${cacheVersion}`
let key = `setup-ruby-bundler-cache-v4-${platform}-${engine}-${version}${cacheVersionSuffix}`
const cwd = process.cwd()
const bundleWith = process.env['BUNDLE_WITH'] || ''
const bundleWithout = process.env['BUNDLE_WITHOUT'] || ''
let key = `setup-ruby-bundler-cache-v5-${platform}-${engine}-${version}-wd-${cwd}-with-${bundleWith}-without-${bundleWithout}`

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

if (common.isHeadVersion(version)) {
if (engine !== 'jruby') {
Expand Down
10 changes: 8 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f60ef1e

Please sign in to comment.