gpt4 book ai didi

git - 如何排除对管道 yaml 文件的更改以触发构建 i azure devops?

转载 作者:行者123 更新时间:2023-12-04 12:20:43 25 4
gpt4 key购买 nike

使用 Azure DevOps 和管道 yaml 文件。在 develop 分支上有一个触发器。但是,当我保存对 yaml 文件的更改时,它会触发一个新的构建。

发生这种情况的原因是对 yaml 文件的更改是触发器捕获的新提交。

所以我的问题是,如何从触发新构建中排除对 yaml 文件的更改?

最佳答案

You can specify file paths to include or exclude. Note that the wildcard syntax is different between branches/tags and file paths.

# specific path build
trigger:
branches:
include:
- master
- releases/*
paths:
include:
- docs/*
exclude:
- docs/README.md
来源: Build Azure Repos Git or TFS Git repositories - CI triggers - Paths
2021 年 4 月编辑:
路径过滤器不支持通配符。
现在取自同一来源:

You can specify file paths to include or exclude.

# specific path build
trigger:
branches:
include:
- master
- releases/*
paths:
include:
- docs
exclude:
- docs/README.md

When you specify paths, you must explicitly specify branches to trigger on. You can't trigger a pipeline with only a path filter; you must also have a branch filter, and the changed files that match the path filter must be from a branch that matches the branch filter.

Tips:

  • Wild cards are not supported with path filters.
  • Paths are always specified relative to the root of the repository.
  • If you don't set path filters, then the root folder of the repo is implicitly included by default.
  • If you exclude a path, you cannot also include it unless you qualify it to a deeper folder. For example if you exclude /tools then you could include /tools/trigger-runs-on-these
  • The order of path filters doesn't matter.
  • Paths in Git are case-sensitive. Be sure to use the same case as the real folders.
  • You cannot use variables in paths, as variables are evaluated at runtime (after the trigger has fired).

关于git - 如何排除对管道 yaml 文件的更改以触发构建 i azure devops?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62172468/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com