From 314ad5776df6976d469350160daa6f42d187c942 Mon Sep 17 00:00:00 2001 From: Sarah German Date: Wed, 11 Jan 2023 16:57:22 +0000 Subject: Revert "Merge branch 'axil-target-branch-upstream' into 'main'" This reverts merge request !3430 --- lib/tasks/task_helpers.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/tasks/task_helpers.rb b/lib/tasks/task_helpers.rb index ab9f19e0..bf5e54ac 100644 --- a/lib/tasks/task_helpers.rb +++ b/lib/tasks/task_helpers.rb @@ -32,10 +32,9 @@ class TaskHelpers if ENV["CI_COMMIT_REF_NAME"].nil? default_branch(products[slug].fetch('repo')) - # If we're on a gitlab-docs stable branch (or targeting one) according to the - # regex, catch the version and assign the product stable branches - # correctly. - elsif version = ENV["CI_COMMIT_REF_NAME"].match(VERSION_FORMAT) || ENV["CI_MERGE_REQUEST_TARGET_BRANCH_NAME"].match(VERSION_FORMAT) + # If we're on a gitlab-docs stable branch according to the regex, catch the + # version and assign the product stable branches correctly. + elsif version = ENV["CI_COMMIT_REF_NAME"].match(VERSION_FORMAT) case slug # EE has different branch name scheme @@ -47,10 +46,8 @@ class TaskHelpers # Charts don't use the same version scheme as GitLab, we need to # deduct their version from the GitLab equivalent one. - # Take the values defined in 'version', and use '.match' to split them - # to :major and :minor so that we can use them to craft the charts version. when 'charts' - chart = chart_version("#{version[:major]}.#{version[:minor]}").match(VERSION_FORMAT) + chart = chart_version(ENV.fetch('CI_COMMIT_REF_NAME', nil)).match(VERSION_FORMAT) "#{chart[:major]}-#{chart[:minor]}-stable" # If the upstream product doesn't follow a stable branch scheme, set the -- cgit v1.2.3