diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9abbcaecd5e54758c48dfbd0eb7631497129e001..209e90e5aa6d563c0421f9701d09187cda020191 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,7 +6,7 @@ stages:
 update_publications:
   stage: update
   script:
-    - git checkout -B ${CI_BUILD_REF_NAME}
+    - git checkout -B ${CI_COMMIT_REF_NAME}
     - git submodule update --init --remote
     - git add publications
     - git commit -m "[AUTO] Updating publications submodule" || exit 0
@@ -14,7 +14,7 @@ update_publications:
     - git remote add rw git@gitlab.doc.ic.ac.uk:${CI_PROJECT_PATH}.git
     - eval `ssh-agent`
     - echo "$PUSH_KEY" | ssh-add -
-    - git push rw ${CI_BUILD_REF_NAME}
+    - git push rw ${CI_COMMIT_REF_NAME}
   variables:
     GIT_AUTHOR_NAME: Resource Reasoning Group Backup Bot
     GIT_COMMITTER_NAME: Resource Reasoning Group Backup Bot