請指定 none 來停用、true 以包含所有分支,或使用如下列範例中所述的完整語法。
參考此定義的定義:resources.pipelines.pipeline
實作
實施 | 說明 |
---|---|
觸發程式:已啟用、分支、階段、標記 | 使用完整語法設定管線資源觸發程式。 |
觸發程式:無 |true | 指定 none 以停用或 true 以包含所有分支。 |
實施 | 說明 |
---|---|
觸發程式:已啟用,分支 | 請指定 none 來停用、true 以包含所有分支,或使用如下列範例中所述的完整語法。 |
觸發程式:無 |true | 指定 none 以停用或 true 以包含所有分支。 |
備註
有數種方式可在管線資源中定義觸發程式。 若要在參考管線的任何執行完成時觸發執行,請使用 trigger: true
。
resources:
pipelines:
- pipeline: source-pipeline
source: TriggeringPipeline
trigger: true
若要停用管線資源觸發程式,請指定 none
的值。
resources:
pipelines:
- pipeline: source-pipeline
source: TriggeringPipeline
trigger: none
若要設定分支篩選,請使用完整的語法。 分支篩選可以指定為要包含的分支清單,或指定為要包含之分支清單與要排除之分支清單的分支清單。
若要指定要包含和排除的分支清單,請使用下列 trigger
語法。
resources:
pipelines:
- pipeline: source-pipeline
source: TriggeringPipeline
trigger:
branches:
include:
- main
- develop
- features/*
exclude:
- features/experimental/*
若要指定要包含的分支清單,不排除、省略 exclude
值,或使用下列語法指定要直接在 branches
之後包含的分支清單。
resources:
pipelines:
- pipeline: source-pipeline
source: TriggeringPipeline
trigger:
branches:
- main
- develop
若要依階段或標記進行篩選,請使用下列 trigger
語法。
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
這很重要
當您定義資源觸發程式時,如果其管線資源來自與目前管線相同的存放庫,則觸發程式會遵循相同的分支並認可引發事件。 但是,如果管線資源來自不同存放庫,則會在 預設分支所指定的分支上觸發目前的管線,以進行手動和排程的組建 設定。 如需詳細資訊,請參閱 管線完成觸發程式的分支考慮。
觸發程式:已啟用、分支、階段、標記
使用完整語法設定管線資源觸發程式。
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.
性能
enabled
布林值。
是否啟用觸發程式;默認為 true。
branches
resources.pipelines.pipeline.trigger.branch。
要包含或排除的分支名稱,以觸發執行。
stages
字串清單。
符合時將觸發管線的階段清單。
tags
字串清單。
符合時會觸發管線的標籤清單。
觸發程式:已啟用,分支
請指定 none 來停用、true 以包含所有分支,或使用如下列範例中所述的完整語法。
trigger:
enabled: boolean # Whether the trigger is enabled; defaults to true.
branches: branches # Branches to include or exclude for triggering a run.
性能
enabled
布林值。
是否啟用觸發程式;默認為 true。
branches
resources.pipelines.pipeline.trigger.branch。
要包含或排除的分支名稱,以觸發執行。
觸發程式:無 |真
指定 none 以停用或 true 以包含所有分支。
trigger: none | true # Specify none to disable or true to include all branches.
trigger
字串。 允許的值:無 |真。
指定 none 以停用或 true 以包含所有分支。