Integrate gitlab-ci/fix-branch-protection-check
Compare changes
Dear all,
On Wednesday, 20 August 2025, we will be setting up and testing a new disaster recovery environment.
1- The initial setup will begin at 9:00 AM CEST and is expected to conclude by midday. No service interruptions are expected in this phase.
2- A disaster recovery test will take place between 4:00 PM and 5:00 PM CEST. Please refrain from making any changes, as they will be lost.
Once testing is complete, the production environment will be restored. Thank you for your understanding.
Commit: seco-ne/yocto/infrastructure/gitlab-ci@23680f48
Fix check for branch protection state
Since the changes of 939ade2b9f98b3e1569332270a7ab16ce7d70b4a we observe that pipelines are executed on non-protected branches, which is not what we want.
GitLab's documentation was a bit unclear on the according CI variables CI_COMMIT_REF_PROTECTED and CI_MERGE_REQUEST_TARGET_BRANCH_PROTECTED, as stated in this stack overflow answer: https://stackoverflow.com/a/59023344/3018229
We need to explicitly check for the variable values to be "true" instead of just checking whether they are set.