diff --git a/rake_tasks/automation.rake b/rake_tasks/automation.rake index 3f729f546a..d49ad10ee5 100644 --- a/rake_tasks/automation.rake +++ b/rake_tasks/automation.rake @@ -114,14 +114,14 @@ namespace :automation do if file == '.buildkite/pipeline.yml' require 'yaml' yaml = YAML.safe_load(content) - yaml_tests_branch = yaml['steps'][0]['env']['ES_YAML_TESTS_BRANCH'] + yaml_tests_branch = yaml['steps'][0]['env']['ES_YAML_TESTS_BRANCH'].to_s if yaml_tests_branch == 'main' old = content.match(/STACK_VERSION: (.*)/)[1] new = "STACK_VERSION: #{version}" content.gsub!(new, old) else - branch = version.match(/([0-9]+\.[0-9]+)\.[0-9]+.*/)[1] + branch = version.to_s.match(/([0-9]+\.[0-9]+)\.[0-9]+.*/)[1] content.gsub!(yaml_tests_branch, branch) end puts "[#{yaml_tests_branch}] -> [#{branch}] in #{file.gsub('./', '')}"