如何将根级别的所有文件作为触发器添加到 Azure Devops - Pipeline?
目前我的设置如下:
pr:
branches:
include:
- '*'
paths:
include:
- '*' # this matches all files in the repository
- apps/*
目的是通过根级文件(即 package.json
)和 apps 文件夹中的文件的更改来触发 pr 构建。但是,包含 *
确实会匹配我的存储库中的所有文件,而不是根级文件。
documentation在这里帮不了我。有没有办法将所有根级文件包含到触发器中,而无需手动包含每个文件?
最佳答案
这里同意 Krzysztof Madej 的观点,'*' # 与存储库根目录的 '/' 相同
,这里是 document你可以引用一下。如果您不希望根目录下的文件夹的子文件触发管道,则需要在paths
过滤器中添加exclude
。
例如:
trigger:
branches:
include:
- master
paths:
include:
- '*'
exclude:
- '/test01/'
那么对 test0
文件的更改将不会触发管道。
关于Azure管道: file-trigger for files on root level,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63788704/