From 568eef6ce4794094fdfd88c270f326c1a207dfd4 Mon Sep 17 00:00:00 2001
From: Maarten de Waard <maarten@greenhost.nl>
Date: Mon, 13 Dec 2021 16:21:54 +0100
Subject: [PATCH] fix helm_package template for repos that do not use main for
 the default branch

---
 .gitlab/ci_templates/helm_package.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.gitlab/ci_templates/helm_package.yml b/.gitlab/ci_templates/helm_package.yml
index 78b87dafa..08eaf6828 100644
--- a/.gitlab/ci_templates/helm_package.yml
+++ b/.gitlab/ci_templates/helm_package.yml
@@ -49,14 +49,14 @@ package-chart:
   extends:
     - .chart_release_rules
 
-# Push helm chart. Charts on the `main` branch are pushed to `stable`, others
+# Push helm chart. Charts on the default branch are pushed to `stable`, others
 # are pushed to the `unstable` channel.
 release-helm:
   image: "rancher/curlimages-curl:7.73.0"
   stage: release-helm-chart
   script:
     - cd ${CHART_DIR:-"."}
-    - if [ "$CI_COMMIT_BRANCH" == "main" ]; then export HELM_CHANNEL='stable'; else export HELM_CHANNEL='unstable'; fi
+    - if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then export HELM_CHANNEL='stable'; else export HELM_CHANNEL='unstable'; fi
     - export CHART_FILE=$(ls ${CHART_NAME}-*.tgz)
     - curl --fail --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@${CHART_FILE}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/${HELM_CHANNEL}/charts"
   extends:
-- 
GitLab