ericmjl
ericmjl

Reputation: 14684

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

This is a question raised for the pyjanitor project.

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. Hence, my question is kind of two-fold:

  1. Is it possible to trigger build such that we only check PRs?
  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?

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.

Looking through the suggested duplicate, I did not find anything about how to configure my Pipeline YAML to disable build after PR merge. The suggested "branch policies" thing also does not show up on my Pipelines dashboard.

Upvotes: 5

Views: 3673

Answers (1)

4c74356b41
4c74356b41

Reputation: 72171

if you want to disable build after merge - disable commit trigger.

yaml:

trigger: none

Upvotes: 7

Related Questions