trigger definition

A push trigger specifies which branches cause a continuous integration build to run.

Definitions that reference this definition: pipeline, resources.repositories.repository

Definitions that reference this definition: pipeline

Implementations

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.
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.

Remarks

For more information about using triggers with a specific repository type, see Supported source repositories.

If you specify no push trigger, pushes to any branch trigger a build.

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.

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.

If you specify an exclude clause without an include clause for branches, tags, or paths, it is equivalent to specifying * in the include clause.

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.

trigger: none

Disable CI triggers.

trigger: none # Disable CI triggers.

trigger string. Allowed values: none.

Disable CI triggers.

Examples

trigger: none # will disable CI builds entirely

trigger: string list

List of branches that trigger a run.

trigger: [ string ] # List of branches that trigger a run.

List types

Type Description
string List of branches that trigger a run.

Examples

trigger:
- main
- develop

trigger: batch, branches, paths, tags

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.

Properties

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.

trigger: batch, branches, paths

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.

Properties

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.

Remarks

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.

Important

batch is not supported in repository resource triggers.

For more information, see Triggers - CI triggers and choose your repository type.

# specific branch build with batching
trigger:
  batch: true
  branches:
    include:
    - main

Examples

trigger:
  batch: true
  branches:
    include:
    - features/*
    exclude:
    - features/experimental/*
  paths:
    exclude:
    - README.md

See also

Learn more about triggers and how to specify them.