Problem to solve
We are using merge request and branch pipelines, see: Types of pipelines | GitLab Docs
It is already configured that branch pipelines will not be created if there is an MR for the branch.
My usual workflow is to create a branch, add some commits and then, when I push it for the first time to the remote I will also then create a merge request for it.
This results in two pipelines for the same branch, once because I pushed the branch and the second one because the merge request was created.
See: Merge request pipelines | GitLab Docs
Is there a way to find out via any Predefined CI/CD variables reference | GitLab Docs whether this merge_request_event was due to the creation of the MR or just because it was updated? I basically don’t ever want to create a new pipeline just because the MR created. Only if I push a commit.
So code like this the following is not what I’m looking for as I generally want MR pipelines
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
when: never