@@ -105,6 +105,7 @@ namespace :automation do
105105 DESC
106106 task :bumpmatrix , :version do |_ , args |
107107 abort ( '[!] Required argument [version] missing' ) unless ( version = args [ :version ] )
108+ version = args [ :version ] . to_s
108109 gh_actions = [
109110 File . expand_path ( '../.github/workflows/main.yml' , __dir__ ) ,
110111 File . expand_path ( '../.github/workflows/otel.yml' , __dir__ ) ,
@@ -114,9 +115,9 @@ namespace :automation do
114115 files . each do |file |
115116 content = File . read ( file )
116117 if file == '.buildkite/pipeline.yml'
117- pipeline ( content , args [ : version] )
118+ pipeline ( content , version )
118119 elsif file . include? ( '.github/workflows/' )
119- workflows ( content , args [ : version] )
120+ workflows ( content , version )
120121 end
121122 File . open ( file , 'w' ) { |f | f . puts content }
122123 puts "[#{ version } ] in #{ file . to_s . gsub ( './' , '' ) } "
@@ -125,7 +126,7 @@ namespace :automation do
125126
126127 def pipeline ( content , version )
127128 yaml = YAML . safe_load ( content )
128- yaml_tests_branch = yaml [ 'steps' ] [ 0 ] [ 'env' ] [ 'ES_YAML_TESTS_BRANCH' ]
129+ yaml_tests_branch = yaml [ 'steps' ] [ 0 ] [ 'env' ] [ 'ES_YAML_TESTS_BRANCH' ] . to_s
129130
130131 if yaml_tests_branch == 'main'
131132 branch = yaml_tests_branch
@@ -141,7 +142,7 @@ namespace :automation do
141142 def workflows ( content , version )
142143 yaml = YAML . safe_load ( content )
143144 tests = yaml [ 'name' ] == 'opentelemetry' ? 'otel' : 'main'
144- old_version = yaml [ 'jobs' ] [ "test-#{ tests } " ] [ 'steps' ] [ 2 ] [ 'with' ] [ 'stack-version' ]
145+ old_version = yaml [ 'jobs' ] [ "test-#{ tests } " ] [ 'steps' ] [ 2 ] [ 'with' ] [ 'stack-version' ] . to_s
145146 return if old_version == version
146147
147148 content . gsub! ( old_version , version )
0 commit comments