Every push to a repository triggers new AppVeyor build. If you are committing minor changes, say update to a documentation or static web page, you might want to skip a build. This article explains how to make AppVeyor starting new builds based on the contents of commit message, commit author or files affected by commit.
Currently, commits filtering functionality is available in
appveyor.yml configuration only.
Commits filtering does not apply to builds started with UI, API or scheduled build.
skip_commits.message setting allows skipping commits with a message title matching regular expression.
For example, the following configuration won’t start new builds on commits with
[chore] in their message:
skip_commits: message: /\[chore\]/
Regular expressions should be surrounded by /, otherwise Appveyor will do simple case insensitive string comparison.
NOTE: AppVeyor searches for skip commit string in the commit message title only (text before first empty line) only. This is done to prevent confusion when squashed commits are not being built in case older commit (in the squashed commits list) has skip commit string.
AppVeyor searches for [skip ci] / [ci skip] / [skip appveyor] in the commit message title only. This avoids confusion when squashing commits, in particular with the GitHub squash-and-merge feature.
AppVeyor supports “standard” directives to skip a build of particular commit.
[skip ci] or
[ci skip] to commit message title and build won’t be triggered by AppVeyor for that commit. Or explicitly skip AppVeyor only with
[skip appveyor] and still allow any other CI to build the commit (eg. Travis CI).
] brackets in
[skip ci], etc are required! Not just the text inside the brackets.
NOTE: Similarly to custom skip commit message, AppVeyor searches for [skip ci] / [ci skip] / [skip appveyor] in the commit message title only. This avoids confusion when squashing commits, in particular with the GitHub squash-and-merge feature.
only_commits.message setting allows triggering a new build only if commit message matches regular expression.
For example, to start a new build only if commit message contains string
build use this configuration:
only_commits: message: /build/
You can setup a filter to skip builds coming from specific author(s).
author value can be author’s username, name, email or regular expression matching one of these.
For example, to skip all commits from author with name
John Smith add this:
skip_commits: author: John Smith
You can use regular expression to skip commits from several persons:
skip_commits: author: /John|Jack/
only_commits.author setting allows triggering a new build only if commit message comes from specific author(s), for example:
only_commits: author: /Alice|Mark/
skip_commits.files allows skipping AppVeyor build if all of the files modified in push’s head commit match any of the file matching rules (
AND logic applied to multiple values):
skip_commits: files: - dir/* - dir/*.md - full/path.txt - another/dir/here/ - '**/*.html'
For example, if
appveyor.yml contains the following rules:
skip_commits: files: - docs/* - '**/*.html'
and push commit modified two files:
project-A/mysolution.sln the build will be started as there is no rule matching
For the same set of rules commit modifying
site/views/index.html files won’t start a build as both files match their respective rules.
only_commits.files allows starting a new AppVeyor build if only some of the files modified in push’s head commit match their respective rules (
OR logic applied to multiple values):
appveyor.yml contains these rules:
only_commits: files: - Project-A/ - Project-B/
which means the build will be started only if one of the modified files was inside either
dir/*- all files within directory, non-recursive
dir/**/*- all files within directory, recursive
dir/- all files within directory, recursive
test/readme- specific file
full/path.txt- specific file
.htmlfiles within repository, recursive
/slashes are allowed.
The following example triggers new build for changes in
src\ProjectA folder only:
only_commits: files: - src\ProjectA\