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

actions/sync/shared-config: align Bundler version with Homebrew/brew #132

Merged
merged 1 commit into from
Jun 14, 2024
Merged
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: 8 additions & 2 deletions .github/actions/sync/shared-config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def git(*args)
(homebrew_repository_path/"Library/Homebrew/vendor/portable-ruby-version").read
.chomp
.sub(/_\d+$/, "")
homebrew_gemfile = (homebrew_repository_path/"Library/Homebrew/Gemfile")
homebrew_gemfile_lock = (homebrew_repository_path/"Library/Homebrew/Gemfile.lock")
homebrew_rubocop_config_yaml = YAML.load_file(
homebrew_repository_path/"Library/#{rubocop_yaml}",
permitted_classes: [Symbol, Regexp],
Expand Down Expand Up @@ -180,8 +182,12 @@ def git(*args)
# We don't have Homebrew exclude? method here.
if !custom_ruby_version_repos.include?(repository_name) && (target_directory_path/"Gemfile.lock").exist?
Dir.chdir target_directory_path do
puts "Running bundle install..."
system "bundle update --ruby --bundler --quiet >/dev/null"
require "bundler"
bundler_version = Bundler::Definition.build(homebrew_gemfile, homebrew_gemfile_lock, false)
.locked_gems
.bundler_version
puts "Running bundle update (with Bundler #{bundler_version})..."
system "bundle", "update", "--ruby", "--bundler=#{bundler_version}", "--quiet", out: "/dev/null"
end
end
# rubocop:enable Homebrew/NegateInclude
Expand Down