I have a GitLab Pipeline with following trigger rule
rules:
- if: $CI_MERGE_REQUEST_IID
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
Currently this runs on every commit which is part of a merge request to master. I would like to only run the pipeline once the merge request is merged in to master. I can change the rule to:
only:
- master
However, then I do not have access to the information I need from $CI_MERGE_REQUEST_IID
How can I run a pipline after a merge request has been merged in to master while having access to $CI_MERGE_REQUEST_IID
?