[英]Azure Devops build pipeline: CI triggers not working on PR merge to master when PR set to none
需要在 PR 合并到 master 时触发 CI 构建作业(仅当更改在 ./rel/* 路径内时),但在创建 Pull Request (PR) 时不会触发 CI 构建。 所以我有如下的触发器配置。
trigger:
branches:
include:
- master
paths:
include:
- ./rel/*
pr: none # will disable PR builds (but not CI builds)
但是当pr: none
被添加时,它无法触发 CI 构建。 如果pr: none
被删除,则 PR 和合并到 master 都会触发作业。 我只需要作业/CI 构建在合并到 master 时运行。
YAML 中的paths
过滤器正在查看存储库文件结构中的路径,而不是分支路径。 要让它只在 rel 分支上触发,请将包含分支下的 master 替换为./rel/*
(或正确的值)。
我们有一个更明确的管道,它在 PR 上运行单元测试,然后只在合并到主分支时发布包。 我们通过将触发器设置到主分支并使用多阶段管道中每个阶段的条件来做到这一点。 也检查一下。
解决了! 这现在有效。
trigger:
branches:
include:
- master
paths:
include:
- ./rel/*
pr: none # will disable PR builds (but not CI builds)
您还可以使用来自触发器的经典 azure devops UI 配置/覆盖。
参考: https : //docs.microsoft.com/en-us/azure/devops/pipelines/repos/azure-repos-git? view = azure-devops & tabs = classic#ci- triggers
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.