I would like to disable the pipeline when creating a branch because its configuration is the same as the master branch and to reduce pipeline time.
So I would like to set up the .gitlab-ci.yml as described above, but I am not sure how to do it.
How can I do that?
If you want to prevent pipelines from executing I’d suggest using the
workflow:rules section of the
With those, you can write some rules that get applied to the whole pipeline instead of having to write the rules on every job.
You can find some examples on the official docs here:
.gitlab-ci.yml keyword reference | GitLab
The example on that docs page, specifically shows how to setup the pipeline so that it gets created only for the default branch and for push event on branches that are used in merge requests