I’m trying to get pipeline running when merge request is done. But the merge_request_event is not triggered:
The .gitlab-ci.yml is looking approximately like this:
Another means of doing this is by a declaring a workflow as such:
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" # creates a merge request pipeline
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never # does not create branch pipelines if a merge request is open for that branch
- if: $CI_COMMIT_BRANCH # if none of the above are true, create branch pipeline
This allows you to create and differentiate between merge request pipelines and branch pipelines. This also ensures you have access to these merge request pipelines specific predefined variables.