diff --git a/.gitlab/ci/build.gitlab-ci.yml b/.gitlab/ci/build.gitlab-ci.yml
index b299e109f4a6cb0e17ffb45dfdedb25217864d6e..15fde5d1e14875029add83c5d151b67b4df0f007 100644
--- a/.gitlab/ci/build.gitlab-ci.yml
+++ b/.gitlab/ci/build.gitlab-ci.yml
@@ -13,7 +13,6 @@ build:ubuntu_cpp:
     - DEPENDENCY_JOB="build:ubuntu_cpp"
     # - !reference [.download_dependency, script]
     - apt-get -qq install -y jq
-    - BRANCH_TO_PULL="dev" # default branch
     # Check if a branch with the same name exist on the dependance repository
     - >
       if [ "$CI_MERGE_REQUEST_ID" ]; then
@@ -26,11 +25,12 @@ build:ubuntu_cpp:
               BRANCH_TO_PULL=${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}
           fi
       elif [ $(curl -s -o /dev/null -w "%{http_code}" "https://gitlab.eclipse.org/eclipse/aidge/$DEPENDENCY_NAME/-/tree/$CI_COMMIT_REF_NAME") -eq 404 ]; then
+          BRANCH_TO_PULL="dev" # default branch
       else
           # Pulling from branch with same name
           BRANCH_TO_PULL=${CI_COMMIT_REF_NAME}
       fi
-      echo "Pull from branch : $BRANCH_TO_PULL"
+    - echo "Pull from branch : ${BRANCH_TO_PULL}"
     # Check group namespace is valid, if it is then we are in the official project(aidge group id=6437), otherwise we pull from the fork 
     - >
       set -x