GitLab: Rules and Needs
In GitLab CI, a job has rules: with one entry, - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH. What happens in a merge request pipeline?
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
Choose one answer
The pipeline fails with a configuration error.
The job is not added: no rule matches, because CI_COMMIT_BRANCH is empty there.
CI_COMMIT_BRANCH
The job runs but is marked as allowed to fail.
The job runs, because jobs without a matching rule fall back to when: on_success.
when: on_success