Skip to content

Latest commit

 

History

History
285 lines (230 loc) · 9.52 KB

resources-pipelines-pipeline-trigger.md

File metadata and controls

285 lines (230 loc) · 9.52 KB
title description ms.date monikerRange
resources.pipelines.pipeline.trigger definition
Specify none to disable, true to include all branches, or use the full syntax as described in the following examples.
03/02/2023
>=azure-pipelines-2020

resources.pipelines.pipeline.trigger definition

:::moniker range=">=azure-pipelines-2020"

Specify none to disable, true to include all branches, or use the full syntax as described in the following examples.

:::moniker-end

:::moniker range=">=azure-pipelines-2020"

Definitions that that reference this definition: resources.pipelines.pipeline

:::moniker-end

Implementations

:::moniker range=">=azure-pipelines-2020.1"

Implementation Description
trigger: enabled, branches, stages, tags Configure pipeline resource triggers using the full syntax.
[trigger: none true](#triggerstring)

:::moniker-end

:::moniker range="=azure-pipelines-2020"

Implementation Description
trigger: enabled, branches Specify none to disable, true to include all branches, or use the full syntax as described in the following examples.
[trigger: none true](#triggerstring)

:::moniker-end

Remarks

There are several ways to define triggers in a pipeline resource. To trigger a run when any run of the referenced pipeline completes, use trigger: true.

resources:
  pipelines:
  - pipeline: source-pipeline
    source: TriggeringPipeline
    trigger: true

To disable the pipeline resource trigger, specify a value of none.

resources:
  pipelines:
  - pipeline: source-pipeline
    source: TriggeringPipeline
    trigger: none

To configure branch filters, use the full syntax. Branch filters can be specified as a list of branches to include, or as a list of branches to include combined with a list of branches to exclude.

To specify a list of branches to include and exclude, use the following trigger syntax.

resources:
  pipelines:
  - pipeline: source-pipeline
    source: TriggeringPipeline
    trigger:
      branches:
        include:
        - main
        - develop
        - features/*
        exclude:
        - features/experimental/*

To specify a list of branches to include, with no excludes, omit the exclude value, or use the following syntax to specify the list of branches to include directly following branches.

resources:
  pipelines:
  - pipeline: source-pipeline
    source: TriggeringPipeline
    trigger:
      branches:
      - main
      - develop

:::moniker range=">= azure-pipelines-2020.1"

To filter by stages or tags, use the following trigger syntax.

resources:
  pipelines:
  - pipeline: source-pipeline
    source: TriggeringPipeline
    trigger:
      branches: # Branches to include
      tags: # List of tags that when matched will trigger the pipeline. 
      - release25
      stages: # List of stages that when complete will trigger the pipeline. 
      - build

:::moniker-end

For more information, see Pipeline completion triggers.

Important

When you define a resource trigger, if its pipeline resource is from the same repo as the current pipeline, triggering follows the same branch and commit on which the event is raised. But if the pipeline resource is from a different repo, the current pipeline is triggered on the branch specified by the Default branch for manual and scheduled builds setting. For more information, see Branch considerations for pipeline completion triggers.

:::moniker range=">=azure-pipelines-2020.1"

trigger: enabled, branches, stages, tags

Configure pipeline resource triggers using the full syntax.

trigger:
  enabled: boolean # Whether the trigger is enabled; defaults to true.
  branches: branches # Branches to include or exclude for triggering a run.
  stages: [ string ] # List of stages that when matched will trigger the pipeline.
  tags: [ string ] # List of tags that when matched will trigger the pipeline.

Properties

enabled boolean.
Whether the trigger is enabled; defaults to true.

branches resources.pipelines.pipeline.trigger.branches.
Branch names to include or exclude for triggering a run.

stages string list.
List of stages that when matched will trigger the pipeline.

tags string list.
List of tags that when matched will trigger the pipeline.

:::moniker-end

:::moniker range="=azure-pipelines-2020"

trigger: enabled, branches

Specify none to disable, true to include all branches, or use the full syntax as described in the following examples.

trigger:
  enabled: boolean # Whether the trigger is enabled; defaults to true.
  branches: branches # Branches to include or exclude for triggering a run.

Properties

enabled boolean.
Whether the trigger is enabled; defaults to true.

branches resources.pipelines.pipeline.trigger.branches.
Branch names to include or exclude for triggering a run.

:::moniker-end

:::moniker range=">=azure-pipelines-2020"

trigger: none | true

Specify none to disable or true to include all branches.

trigger: none | true # Specify none to disable or true to include all branches.

trigger string. Allowed values: none | true.

Specify none to disable or true to include all branches.

:::moniker-end