我正在为 GitHub 存储库编写一个 Azure DevOps 管道,它将在 main
分支上包含一个 trigger
,并且还为 pr
。它们都将使用相同的排除
路径
。我的 yaml 文件的开头如下所示:
trigger:
branches:
include:
- main
paths:
exclude:
- '.gitignore'
- '.vscode/*.*'
- '*.md'
- 'LICENSE'
# etc.
pr:
branches:
include:
- main
paths:
exclude:
- '.gitignore'
- '.vscode/*.*'
- '*.md'
- 'LICENSE'
# etc.
现在的问题是排除
列表可以变得非常具体和扩展,我预计在我的现实场景中最多有 20 个项目。
有没有办法删除该列表的重复项?您可以使用变量或模板或其他一些功能来将列表分解到某个地方吗?
最佳答案
Is there a way to deduplicate that list? Can you use variables or templates or some other feature to factor that list out somewhere?
恐怕目前还没有这样的方法来删除重复的触发过滤器列表。
这是因为触发器应该在主 yaml azure 管道中定义,而不是在嵌套模板 yaml 中。
您可以在我们的 UserVoice 网站 ( https://developercommunity.visualstudio.com/content/idea/post.html?space=21 ) 上添加对此功能的请求,该网站是我们提供产品建议的主要论坛。
关于azure - 对 Azure Devops YML 管道中的 "exclude"路径进行重复数据删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71729567/