If you want to skip a specific commit, to not to start a build,
all you have to do is to include either [skip ci]
or [ci skip]
in the commit message.
For example, the commit message:
This is not important, please [skip ci]
won’t start a build, nor will:
I just changed the README
[ci skip]
If you’d decide that you still want to start a build you’ll have to either rebase that commit (e.g. just change its commit message), or push another commit.
Pull Requests ⚓
Skip CI works for Pull Requests too, but a little bit differently, due to how Pull Requests are handled on the git source code hosting services.
In short, what you have to know is that Pull Requests are virtual/temporary “commits” / “branches”.
In case of GitHub there’s actually a pull request related “virtual branch” (ref), which, if you know
its name, you can fetch
through git
(if you add the related refs/
to your git fetch
config).
This “branch” (ref) is also removed / made unaccessible after you close the pull request.
Other services like Bitbucket doesn’t even create this virtual branch / ref, the pull request is just
a virtual data but can’t be accessed through git
directly.
This means that, if you want to skip a pull request, you have to include the Skip CI pattern in the Pull Request’s title or description, and not in the commit’s message!
Once you decide to not to skip the Pull Request / more commits in the pull request you can simply remove the Skip CI pattern from the Pull Request’s title or description, which should automatically trigger a new build with the latest commit, and all future commits of the pull request will be built too (unless you add a Skip CI pattern again).