Skip CI in the next push commit
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 offer this feature, allowing developers to automatically trigger pipelines on every commit. However, sometimes you want to prevent running your CI. You have different reasons, like:
- You are in the middle of feat/fix, and no need to run ci
- Your commit only includes fixing a typo, changing a word at docs, or …
- You are testing a feature that does not need a ci
- …
This list can continue. But one thing is clear Don't run the ci.
In Gitlab ci, you can prevent running ci easily. There are 2 methods for that:
A. Custom Tag at Your message
Put [Skip ci] or [ci Skip] in your commit message.
git commit -m “Your fancy message [skip ci]” or git commit -m “Your fancy message [ci skip]
B. Using Git push options
In this scenario, you can skip ci execution for a specific commit push
git push origin <branch> --push-option=ci.skip or git push -o ci.skip
At Method B, you can do a lot of cool things. I recommend reading its documentation.