diff --git a/ci-templates/default.yml b/ci-templates/default.yml
index bb0d5538bb3ecf2424bc1b9bdf05137db1eb8a46..e49b634243ca7c5870671034b0027e80ea233d53 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"