Disable pipeline for every commit in Gitlab and only run it on open merge request

jj123456 picture jj123456 · Jul 19, 2018 · Viewed 11.2k times · Source

The CI pipeline runs on every commit in my Gitlab repository at work. Is there way to disable that and only run the CI pipeline on an open merge request to the master branch?

Any help is appreciated. Thanks.

Answer

yamenk picture yamenk · Jan 3, 2019

There is currently no configuration option to do that. Here are some things that can be used to "disable" a pipeline build.

  • Adding [ci skip] inside the commit message will not trigger a pipeline on push.
  • Using except and only options on all jobs inside the pipeline. To avoid duplication in this case, you can use Anchors.

Update: GitLab 11.7

When pushing to GitLab you can skip triggering a pipeline by passing ci.skip option to the push command: git push -o ci.skip