Skip to content

Commit

Permalink
Automation: Fixes bumpmatrix for main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed Sep 9, 2024
1 parent 4189056 commit 8aa948f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions rake_tasks/automation.rake
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,14 @@ namespace :automation do
files.each do |file|
content = File.read(file)
if file == '.buildkite/pipeline.yml'
require 'yaml'
yaml = YAML.safe_load(content)
branch = version.match(/([0-9]+\.[0-9]+)\.[0-9]+.*/)[1]
old_branch = content.match(/ES_YAML_TESTS_BRANCH: ([0-9.]+)/)[1]
content.gsub!(old_branch, branch)
puts "[#{old_branch}] -> [#{branch}] in #{file.gsub('./', '')}"
yaml_tests_branch = yaml['steps'][1]['env']['ES_YAML_TESTS_BRANCH']
next if yaml_tests_branch == 'main'

content.gsub!(yaml_tests_branch, branch)
puts "[#{yaml_tests_branch}] -> [#{branch}] in #{file.gsub('./', '')}"
end
match = content.match(regexp)
next if match.nil?
Expand Down

0 comments on commit 8aa948f

Please sign in to comment.