diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 448f1289147859636c0933c1373b50c4b4983728..4dfa99433ddfb1e0ddc62f5f32000d9c8872d38b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -38,7 +38,7 @@ publish-package-json-version-as-git-tag:
       - main
   script:
     - NPM_VERSION=$(grep '"version":' package.json -m 1 | cut -d '"' -f 4)
-    - MATCHING_GIT_TAG=$(git tag | grep ^NPM_VERSION$)
+    - MATCHING_GIT_TAG=$(git tag | grep ^${NPM_VERSION}$)
     - if [ -z $MATCHING_GIT_TAG ]; then
     -     echo adding git tag for first commit on main with NPM version ${NPM_VERSION}
     -     git remote remove origin