Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure DevOps batch for Pull requests

Tags:

azure-devops

I use batch: true for Azure DevOps pipeline's trigger:

trigger:
  batch: true
  branches:
    include:
    - master

..and it works as expected (next build starts only when previous completed).

By default multiple build are running in parallel: enter image description here

I tried:

pr:
  batch: true
  branches:
    include:
    - master

..but it fails: enter image description here

How can I do the same for Pull requests?

like image 243
kagarlickij Avatar asked Apr 03 '26 00:04

kagarlickij


1 Answers

Batch will only work with CI trigger at the moment.

Pull request (PR) triggers cause a build to run whenever a pull request is opened with one of the specified target branches, or when changes are pushed to such a pull request.

By default, pipelines triggered by pull requests (PRs) will be canceled if a new commit is pushed to the same PR. You can auto cancel an existing pipeline when a pull request is updated.

This is desirable in most cases since usually you don't want to continue running a pipeline on out-of-date code. If you don't want this behavior, you can add autoCancel: false to your PR trigger.

  pr: 
      autoCancel: false
      branches:
      - master

More details please kindly refer our official doc here: Specify events that trigger pipeline builds and releases

like image 129
PatrickLu-MSFT Avatar answered Apr 04 '26 13:04

PatrickLu-MSFT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!