1 min read · Aug 24, 2023
--
The automation of software development processes has significantly evolved through CI/CD (Continuous Integration / Continuous Delivery) pipelines. GitLab CI is one of the platforms that offers this feature, allowing developers to automatically trigger pipelines on every commit. However, there are cases where you might want to skip pipeline execution for certain commits. In this article, we’ll explore two method of achieving this goal.
Method 1 : Using Custom Tags
A common approach is to use custom tags in the commit message. For instance, you could add `[skip ci]` or `[ci skip]` in the commit message. GitLab CI is designed to recognize these tags and will avoid executing the pipeline for commits that include them.
git commit -m "Bug fix [skip ci]" or git commit -m "Bug fix [ci skip]"
Method 2: Using Push Options
To skip the execution of a Gitlab CI pipeline for a specific push, you can include a push option in your git push
command. This option will signal Gitlab Ci to bypass pipeline execution.
git push origin <branch> --push-option=ci.skip or git push -o ci.skip