Skip or cancel jobs and workflows
This document describes how to skip or cancel work when triggering pipelines. There are a couple of ways to do this. The jobs within a pipeline can be skipped on commit, or workflows can be cancelled using the auto-cancel feature. Both methods are described below.
Skip jobs
By default, CircleCI automatically triggers a pipeline whenever you push changes to your project. You can override this behavior by adding a [ci skip]
or [skip ci]
tag within the first 250 characters of the body or title of the commit. This not only skips the marked commit, but also all other commits in the push.
Scope
A few points to note regarding the scope of the ci skip
feature:
- The pipeline and workflows will still exist for these commits but no jobs will be run.
- If you push multiple commits at once, a single
[ci skip]
or[skip ci]
will skip the build for all commits. - This feature is not supported for fork PRs. Scheduled workflows will run even if you push a commit with
[ci skip]
message. Changing the config file is the way to upgrade the current schedule.
Example commit title
$ git log origin/master..HEAD
commit 63ce74221ff899955dd6258020d6cb9accede893
Author: Daniel Woelfel
Date: Wed Jan 23 16:48:25 2017 -0800
fix misspelling [ci skip]
When pushed to a VCS, this commit will not be built on CircleCI because of the [ci skip]
in the commit title.
Example commit description
$ git log origin/master..HEAD
commit 99b4ce4d59e79cb379987b39c65f7113631f0635
Merge: 16ba8ca adc6571
Author: Daniel Woelfel
Date: Tue Apr 25 15:56:42 2016 -0800
A large feature with squashed commits
[skip ci] Fix bug in feature
Refactor feature code
First attempt at feature
When pushed to a VCS, this commit will not be built on CircleCI because of the [ci skip]
or [skip ci]
in the commit description.
Auto-cancel redundant workflows
If you are frequently pushing changes to a branch, you increase the chances of queueing. This means you might have to wait for an older pipeline to complete before the most recent version starts.
To save time, you can configure CircleCI to automatically cancel any non-terminated workflows when a newer pipeline is triggered on that same branch.
Scope
A few points to note regarding the use of the auto-cancel feature:
- Your project’s default branch (usually
main
) will never auto-cancel workflows. - Auto-cancel affect pipelines triggered by pushes to a VCS or via the API.
- Only workflows that are triggered when the feature is enabled will be auto-cancelled.
Enable auto-cancel
-
In the CircleCI application, go to your Project Settings.
-
Click on Advanced Settings.
-
Toggle the switch to enable the Auto-cancel redundant workflows option.
Projects which have auto-cancel enabled will have pipelines and workflows on non-default branches cancelled when a newer build is triggered on that same branch, with the following exceptions:
- Scheduled workflows
- Re-run workflows
Help make this document better
This guide, as well as the rest of our docs, are open source and available on GitHub. We welcome your contributions.
- Suggest an edit to this page (please read the contributing guide first).
- To report a problem in the documentation, or to submit feedback and comments, please open an issue on GitHub.
- CircleCI is always seeking ways to improve your experience with our platform. If you would like to share feedback, please join our research community.
Need support?
Our support engineers are available to help with service issues, billing, or account related questions, and can help troubleshoot build configurations. Contact our support engineers by opening a ticket.
You can also visit our support site to find support articles, community forums, and training resources.
CircleCI Documentation by CircleCI is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.