How do I disable the pipeline when creating a branch?

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?

Hi @tomyam2020 :wave:

If you want to prevent pipelines from executing Iā€™d suggest using the workflow:rules section of the .gitlab-ci.yml :slightly_smiling_face:

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 :slightly_smiling_face:

2 Likes