From dd8159e2fb4f3075a9f041cbac50fb91f39916ce Mon Sep 17 00:00:00 2001
From: Dimitrios Giannopoulos <dimit.giannopoulos@upnet.gr>
Date: Tue, 16 Jul 2024 18:31:16 +0000
Subject: [PATCH] fix: if tag exists and protected branch, APP_VERSION=tag

---
 ci-templates/default.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ci-templates/default.yml b/ci-templates/default.yml
index bb0d553..e49b634 100644
--- a/ci-templates/default.yml
+++ b/ci-templates/default.yml
@@ -8,7 +8,7 @@ stages:
 .default:
   before_script:
     - |
-      if [ "$CI_COMMIT_REF_NAME" = "main" ] && [ -n "$CI_COMMIT_TAG" ]; then
+      if [ "$CI_COMMIT_REF_PROTECTED" = true ] && [ -n "$CI_COMMIT_TAG" ]; then
         export APP_VERSION=$CI_COMMIT_TAG
       elif [ "$CI_COMMIT_REF_NAME" = "develop" ]; then
         export APP_VERSION="develop"
-- 
GitLab