diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b47748503932aa6cb3430dfcaeaca2538e715dbc..99698235cc70bce1c458d61313a5875d794645b3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -35,7 +35,7 @@ job_build_artifact:
 job_publish_artifact:
   stage: publish
   rules: # Conditions under which this job should run
-    - if:   $CI_COMMIT_REF_NAME =~ /^.*$/ # Run this job for any branch or merge request event.
+    - if: $CI_COMMIT_TAG # only for tags
       when: always
   image: curlimages/curl:latest # Custom image with curl
   tags: