diff --git a/.ostc-ci/gitlab-ci.yml b/.ostc-ci/gitlab-ci.yml
index 39e9667a73444ffd4fc295e3dea8c53c756a7c03..70d397ed3ffe97689148b22342dfe0859fff8a54 100644
--- a/.ostc-ci/gitlab-ci.yml
+++ b/.ostc-ci/gitlab-ci.yml
@@ -60,7 +60,7 @@ build-docs:
         # Run this job in case the pipeline changes.
         - .ostc-ci/*.yml
     # Or when things land.
-    - if: '$CI_BRANCH_NAME == "$CI_DEFAULT_BRANCH"'
+    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
       changes:
         # React to changes to the docs directory.
         - docs/**/*