简体   繁体   English

如何仅在PR上触发合并而不在Azure管道上触发构建?

[英]How do I trigger build only on PR, and not after merge, on Azure pipelines?

This is a question raised for the pyjanitor project . 这是对pyjanitor项目提出的问题。

I have build pipelines that are split into jobs, and the jobs are designed to run in parallel. 我已将构建管道拆分为多个作业,并且这些作业被设计为可以并行运行。 However, I noticed that the builds are triggered even after merging PRs. 但是,我注意到即使在合并PR后也会触发构建。 Hence, my question is kind of two-fold: 因此,我的问题有两个方面:

  1. Is it possible to trigger build such that we only check PRs? 是否可以触发仅检查PR的构建?
  2. Is it even good practice to just check PRs, or is there a rationale for building after merge (and also running all the tests) that I might be missing? 仅检查PR还是一种好习惯,还是在合并后(还要运行所有测试)构建可能会丢失的理由?

Update: 更新:

I believe that this question should be distinct from the suggested duplicate because the question I have is how to disable build after PR is merged, rather than forcing a build before PR is made. 我认为该问题应该与建议的重复项不同,因为我的问题是如何 PR合并 禁用构建,而不是在PR创建之前强制构建。

Looking through the suggested duplicate, I did not find anything about how to configure my Pipeline YAML to disable build after PR merge. 查看建议的重复项,我没有找到有关如何配置我的管道YAML以在PR合并后禁用构建的任何信息。 The suggested "branch policies" thing also does not show up on my Pipelines dashboard. 建议的“分支策略”也未显示在“管道”仪表板上。

if you want to disable build after merge - disable commit trigger. 如果要在合并后禁用构建-禁用提交触发器。

yaml: yaml:

trigger: none

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM