diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ec40c55640f7472bfc5fcb4736fe2615d7e53ad3..8ccb0e59d1fd37c0c4196cbe1a1e9989bac9b76b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -7,7 +7,6 @@ stages:
 .build_template:
   stage: build
   script:
-    - unset CI
     - python3 build-locally.py $CONFIG
   artifacts:
     expire_in: 1 month
@@ -21,12 +20,16 @@ stages:
 
 .build_template_build_osx_64:
   extends: .build_template
+  before_script:
+    - unset CI
   tags:
     - macos
     - intel
 
 .build_template_osx_arm64:
   extends: .build_template
+  before_script:
+    - unset CI
   tags:
     - macos
     - arm