From 9aac18333799e52547fa47ed22e221102fef2451 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Fri, 14 Jun 2024 00:03:13 +0100 Subject: [PATCH] actions/sync/shared-config: align Bundler version with Homebrew/brew --- .github/actions/sync/shared-config.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/actions/sync/shared-config.rb b/.github/actions/sync/shared-config.rb index 39acac28..6bdc0b92 100755 --- a/.github/actions/sync/shared-config.rb +++ b/.github/actions/sync/shared-config.rb @@ -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], @@ -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