title | description | ms.date | monikerRange |
---|---|---|---|
trigger definition |
Continuous integration (push) trigger. |
10/04/2024 |
>=azure-pipelines-2019 |
:::moniker range=">=azure-pipelines-2019"
A push trigger specifies which branches cause a continuous integration build to run.
:::moniker-end
:::moniker range=">=azure-pipelines-2020"
Definitions that reference this definition: pipeline, resources.repositories.repository
:::moniker-end
:::moniker range=">=azure-pipelines-2019 <=azure-pipelines-2019.1"
Definitions that reference this definition: pipeline
:::moniker-end
:::moniker range=">=azure-pipelines-2019.1"
Implementation | Description |
---|---|
trigger: none | Disable CI triggers. |
trigger: string list | List of branches that trigger a run. |
trigger: batch, branches, paths, tags | Full syntax for complete control. |
:::moniker-end
:::moniker range="=azure-pipelines-2019"
Implementation | Description |
---|---|
trigger: none | Disable CI triggers. |
trigger: string list | List of branches that trigger a run. |
trigger: batch, branches, paths | Full syntax for complete control. |
:::moniker-end
For more information about using triggers with a specific repository type, see Supported source repositories.
:::moniker range="<= azure-pipelines-2022.1"
If you specify no push trigger, pushes to any branch trigger a build.
:::moniker-end
:::moniker range="> azure-pipelines-2022.1"
YAML pipelines are configured by default with a CI trigger on all branches, unless the Disable implied YAML CI trigger setting is enabled. The Disable implied YAML CI trigger setting can be configured at the organization level or at the project level. When the Disable implied YAML CI trigger setting is enabled, CI triggers for YAML pipelines are not enabled if the YAML pipeline doesn't have a trigger
section. The default value for Disable implied YAML CI trigger is false
.
:::moniker-end
There are three distinct syntax options for the trigger
keyword: a list of branches to include, a way to disable CI triggers, and the full syntax for complete control.
::: moniker range=">= azure-pipelines-2020"
If you specify an exclude
clause without an include
clause for branches
, tags
, or paths
, it is equivalent to specifying *
in the include
clause.
::: moniker-end
::: moniker range="<= azure-pipelines-2019.1"
Important
When you specify a trigger, only branches that you explicitly configure for inclusion trigger a pipeline. Inclusions are processed first, and then exclusions are removed from that list. If you specify an exclusion but no inclusions, nothing triggers.
::: moniker-end
:::moniker range=">=azure-pipelines-2019"
Disable CI triggers.
trigger: none # Disable CI triggers.
trigger
string. Allowed values: none.
Disable CI triggers.
:::moniker-end
trigger: none # will disable CI builds entirely
:::moniker range=">=azure-pipelines-2019"
List of branches that trigger a run.
trigger: [ string ] # List of branches that trigger a run.
Type | Description |
---|---|
string | List of branches that trigger a run. |
:::moniker-end
trigger:
- main
- develop
:::moniker range=">=azure-pipelines-2019.1"
Use the full syntax control for full control over the CI trigger.
trigger:
batch: boolean # Whether to batch changes per branch.
branches: # Branch names to include or exclude for triggering a run.
include: [ string ] # List of items to include.
exclude: [ string ] # List of items to exclude.
paths: # File paths to include or exclude for triggering a run.
include: [ string ] # List of items to include.
exclude: [ string ] # List of items to exclude.
tags: # Tag names to include or exclude for triggering a run.
include: [ string ] # List of items to include.
exclude: [ string ] # List of items to exclude.
batch
boolean.
Whether to batch changes per branch.
branches
includeExcludeFilters.
Branch names to include or exclude for triggering a run.
paths
includeExcludeFilters.
File paths to include or exclude for triggering a run.
tags
includeExcludeFilters.
Tag names to include or exclude for triggering a run.
:::moniker-end
:::moniker range="=azure-pipelines-2019"
Use the full syntax control for full control over the CI trigger.
trigger:
batch: boolean # Whether to batch changes per branch.
branches: # Branch names to include or exclude for triggering a run.
include: [ string ] # List of items to include.
exclude: [ string ] # List of items to exclude.
paths: # File paths to include or exclude for triggering a run.
include: [ string ] # List of items to include.
exclude: [ string ] # List of items to exclude.
batch
boolean.
Whether to batch changes per branch.
branches
includeExcludeFilters.
Branch names to include or exclude for triggering a run.
paths
includeExcludeFilters.
File paths to include or exclude for triggering a run.
:::moniker-end
If you have many team members uploading changes often, you may want to reduce the number of runs you start. If you set batch
to true
, when a pipeline is running, the system waits until the run is completed, then starts another run with all changes that have not yet been built. By default, batch
is false
.
::: moniker range=">= azure-pipelines-2020"
Important
batch
is not supported in repository resource triggers.
::: moniker-end
For more information, see Triggers - CI triggers and choose your repository type.
# specific branch build with batching
trigger:
batch: true
branches:
include:
- main
trigger:
batch: true
branches:
include:
- features/*
exclude:
- features/experimental/*
paths:
exclude:
- README.md
Learn more about triggers and how to specify them.