Merge request pipeline shows `Detached merge request pipeline` and `$CI_COMMIT_BRANCH` is empty.
AdvancedTroubleshootingGitLab CI Failures
Answer
Likely causes → MR pipelines do not set CI_COMMIT_BRANCH; they set CI_MERGE_REQUEST_* variables.
Diagnose → Print CI_PIPELINE_SOURCE and CI_MERGE_REQUEST_SOURCE_BRANCH_NAME.
Fix → Use CI_COMMIT_REF_NAME or MR variables in logic.
Prevent → Test rules in both branch and MR pipelines.
More on GitLab CI Failures
`This GitLab CI configuration is invalid: jobs:build config contains unknown keys: scripts`.BeginnerPipeline is not created: `Pipeline will not run for the selected trigger. The rules configuration prevented any jobs from being added`.Intermediate`ERROR: Job failed: failed to pull image "x" with specified policies [always]: Error response from daemon: pull access denied`.Intermediate`Cannot connect to the Docker daemon at tcp://docker:2375. Is the docker daemon running?`Advanced`ERROR: Job failed (system failure): ... context deadline exceeded` on Kubernetes executor.Advanced`This job is stuck because the project doesn't have any runners online assigned to it.`Beginner