DEV Community

Mohammad Faisal
Mohammad Faisal

Posted on

GitLab - skip pipeline on push

If you have configured a GitLab CI/CD pipeline well then on each push to the repository result in execution of the pipeline. Sometimes it is not desirable to launch the pipeline immediately on the push or you may want to execute the pipeline using a schedule, in such case you can pass additional push option to instruct GitLab to skip the pipeline execution. To do so, the command would be:

git push -o ci.skip
Enter fullscreen mode Exit fullscreen mode

But if you are using any GUI client for git then you will not be able to pass this additional argument to the push command. In that case, you can configure the push.pushOption instead as:

git config --local --add push.pushOption ci.skip
Enter fullscreen mode Exit fullscreen mode

* Make sure to remove this configuration when you no longer want to skip the pipeline on push. To do so, use the --unset option:

git config --local --unset push.pushOption
Enter fullscreen mode Exit fullscreen mode

If you prefer git CLI over GUI then you can create alias for such case:

git config --local --add alias.skipPipeline "push -o ci.skip"
Enter fullscreen mode Exit fullscreen mode

Now you have choice:

  • to skip pipeline use command: git skipPipeline
  • normal push with pipeline execution: git push

I hope you may find this information useful. Feel free to leave your feedback/opinion in comments.

Top comments (1)

Collapse
 
faisal6621 profile image
Mohammad Faisal

There are other push options available in gitlab: docs.gitlab.com/ee/user/project/pu...