azure - 对 Azure Devops YML 管道中的 "exclude"路径进行重复数据删除

标签 azure azure-devops yaml azure-pipelines

我正在为 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  ) 上添加对此功能的请求,该网站是我们提供产品建议的主要论坛。

enter image description here

关于azure - 对 Azure Devops YML 管道中的 "exclude"路径进行重复数据删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71729567/

相关文章:

c# - 将 GitLab Web 应用程序部署到 Azure 应用程序服务

azure - 使用 oauth azure 数据工厂进行分页

azure - 无法对嵌套资源执行请求的操作。找不到父资源 '****.io'

docker - Docker运行Kubernetes部署Yaml

spring - 无法使用 Spring Boot、JUnit5 和 Kotlin 加载带有 @TestPropertySource 的 test-properties.yaml 文件

azure - 按 KQL 中的属性聚合数据

使用模拟存储时出现 Azure StorageException(在记录的限制范围内)

azure - 如何获取 DevOps OwnerID

azure - 如何获取特定任务的Azure管道任务状态?

python - 这个较短的 yaml 输出安全吗