diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a8098fa7fdf14984d46b941afc34ee51e50cb72c..8577261793025109fc79fb3b7e1102db0e59a576 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -31,9 +31,7 @@ release_job:
   stage: release
   image: registry.gitlab.com/gitlab-org/release-cli:latest
   rules:
-    - if: $CI_COMMIT_TAG   # Run this job when a tag is created
-  only:
-    - master  # Only if tag is on main
+    - if: '$CI_COMMIT_REF_NAME == "master" && $CI_COMMIT_TAG'
   script:
     - echo "running release_job"
   release: