ci: use bundler-cache in setup-ruby and fix RuboCop configuration#745
Merged
andrehjr merged 3 commits intosplitrb:mainfrom Feb 15, 2026
Merged
ci: use bundler-cache in setup-ruby and fix RuboCop configuration#745andrehjr merged 3 commits intosplitrb:mainfrom
andrehjr merged 3 commits intosplitrb:mainfrom
Conversation
Replace manual bundle install with ruby/setup-ruby's built-in bundler-cache feature for better compatibility with Ruby 4.0+ security features.
- Add `inherit_mode: { merge: [Exclude] }` to inherit default exclusion patterns
- Remove explicit `vendor/**/*` exclusion (now inherited from default config)
- Remove obsolete `gemfiles/**/*` exclusion (gemfiles directory was removed)
This ensures that `vendor/bundle` is properly excluded when using
`bundler-cache: true` in GitHub Actions workflow, preventing RuboCop
from inspecting gem files and loading their .rubocop.yml configurations.
Fixes the issue where RuboCop tried to require 'rubocop-rake' from
gems installed in vendor/bundle.
Member
|
Awesome! Thanks @snaka 🎉 |
andrehjr
approved these changes
Feb 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes CI failures currently occurring on the main branch.
Background
The manual
bundle installstep was causing CI failures with the following error:This issue is related to stricter security checks introduced in RubyGems/Bundler 4.0.0 combined with incorrect directory permissions in GitHub Actions hosted toolcache. The same issue has been reported in
ruby/rubygems#7983 and ruby/setup-ruby#624.
Changes
Use
bundler-cacheinruby/setup-rubyactionbundle installwithbundler-cache: trueoptionvendor/bundledirectoryConfigure RuboCop to inherit default exclusions
inherit_modeconfiguration to mergeExcludepatterns with RuboCop defaultsvendor/**/*, but when a local.rubocop.ymldefinesAllCops.Exclude, it overrides the defaults instead of merginginherit_mode: { merge: [Exclude] }, we explicitly inherit the default exclusions while allowing custom exclusionsvendor/bundle(where gems are now installed) is properly excluded from lintingSources:
The installation path is insecure. Bundler cannot continue.on GitHub Actions runner. ruby/rubygems#7983