Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,15 @@ export async function installBundler(bundlerVersionInput, rubygemsInputSet, lock
const versionParts = [...bundlerVersion.matchAll(/\d+/g)].length
const bundlerVersionConstraint = versionParts >= 3 ? bundlerVersion : `~> ${bundlerVersion}.0`

await exec.exec(gem, ['install', 'bundler', '-v', bundlerVersionConstraint])
const args = ['install', 'bundler', '-v', bundlerVersionConstraint]
// Reinstalling an exact version that is already there changes nothing, and `gem install`
// removes the gem directory before extracting it again, which breaks the other jobs
// sharing a tool cache on self-hosted runners (#191). A `~>` constraint still gets the
// latest matching release rather than whatever Bundler the Ruby shipped with.
if (versionParts >= 3) {
args.push('--conservative')
}
await exec.exec(gem, args)

return bundlerVersion
}
Expand Down
10 changes: 9 additions & 1 deletion dist/index.js

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