有关将触发器用于特定存储库类型的详细信息,请参阅 支持的源存储库

如果未指定推送触发器,则向任何分支的推送都会触发生成。

trigger 关键字有三种不同的语法选项:要包括的分支列表、禁用 CI 触发器的方法以及用于实现完全控制的完整语法。

如果指定 exclude 子句而不包含 branches tags paths include 子句,则等同于在 include 子句中指定 *

指定触发器时,只有显式配置为包含的分支才会触发管道。 首先处理包含项,然后从该列表中移除排除项。 如果指定排除项但未指定包含项,则不会触发任何操作。

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布尔值
是否对每个分支进行批处理更改。

branchesincludeExcludeFilters
要包含或排除以触发运行的分支名称。

pathsincludeExcludeFilters
要包含或排除以触发运行的文件路径。

tagsincludeExcludeFilters
要包含或排除以触发运行的标记名称。

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布尔值
是否对每个分支进行批处理更改。

branchesincludeExcludeFilters
要包含或排除以触发运行的分支名称。

pathsincludeExcludeFilters
要包含或排除以触发运行的文件路径。

如果有许多团队成员经常上传更改,则可能需要减少启动的运行次数。 如果将 batch 设置为 true,则当管道运行时,系统将等待运行完成,然后启动另一个运行,其中包含尚未生成的所有更改。 默认情况下,batchfalse

存储库资源触发器不支持 batch

有关详细信息,请参阅 触发器 - CI 触发器 并选择存储库类型。

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