Skip to content

Commit a2f5bfd

Browse files
authored
Merge pull request #359 from Homebrew/no_ruby_downgrade
2 parents 12875ed + be28e36 commit a2f5bfd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/actions/sync/shared-config.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,13 @@ def git(*args)
207207

208208
target_path = target_directory_path/"Library/Homebrew/#{ruby_version}" if repository_name == "brew"
209209

210+
if target_path.exist?
211+
target_ruby_version = target_path.read.chomp
212+
213+
# Don't downgrade the Ruby version even if Portable Ruby was downgraded.
214+
next if Gem::Version.new(homebrew_ruby_version) < Gem::Version.new(target_ruby_version)
215+
end
216+
210217
target_path.write("#{homebrew_ruby_version}\n")
211218
when rubocop_yaml
212219
next if custom_rubocop_repos.include?(repository_name)

0 commit comments

Comments
 (0)