Azure管道: file-trigger for files on root level

标签 azure azure-devops azure-pipelines azure-pipelines-yaml

如何将根级别的所有文件作为触发器添加到 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/'

enter image description here

那么对 test0 文件的更改将不会触发管道。

关于Azure管道: file-trigger for files on root level,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63788704/

相关文章:

Git Credential Manager 不断为 Azure DevOps 生成 PAT

azure - 对象/变量内的搜索字符串 - Powershell

python - Azure Pipelines - 使用 Poetry 的正确方法

azure - 我们可以在发布管道 - Azure devOps 中发布工件吗?

azure - SQL Azure 重试逻辑框架 TransientFaultHandling 是否附带默认重试策略?

azure - 引用 azure 管道任务 HelmDeploy@0 中设置的 helm 值

Azure docker : linuxFxVersion vs DOCKER_CUSTOM_IMAGE_NAME

node.js - 哈希与 Azure Blob 存储不匹配(完整性检查失败)

azure - 由于 netcore 3.1.4 安全补丁,Azure 中出现错误

azure-devops - 有条件地在 azure 管道中使用变量组