Skip to content

Commit 97a5c7c

Browse files
committed
Automation: Fixes bumpmatrix for main branch
1 parent 4189056 commit 97a5c7c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

rake_tasks/automation.rake

+7-3
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,14 @@ namespace :automation do
104104
files.each do |file|
105105
content = File.read(file)
106106
if file == '.buildkite/pipeline.yml'
107+
require 'yaml'
108+
yaml = YAML.safe_load(content)
107109
branch = version.match(/([0-9]+\.[0-9]+)\.[0-9]+.*/)[1]
108-
old_branch = content.match(/ES_YAML_TESTS_BRANCH: ([0-9.]+)/)[1]
109-
content.gsub!(old_branch, branch)
110-
puts "[#{old_branch}] -> [#{branch}] in #{file.gsub('./', '')}"
110+
yaml_tests_branch = yaml['steps'][1]['env']['ES_YAML_TESTS_BRANCH']
111+
next if yaml_tests_branch == 'main'
112+
113+
content.gsub!(yaml_tests_branch, branch)
114+
puts "[#{yaml_tests_branch}] -> [#{branch}] in #{file.gsub('./', '')}"
111115
end
112116
match = content.match(regexp)
113117
next if match.nil?

0 commit comments

Comments
 (0)