4
votes

I have a use case where I have two pipelines configured. One for running tests which are triggered by a Pull Request and another pipeline that is handling deployment. I am using Bitbucket cloud in Azure.

Pipeline A - Run through tests on PR.

Pipeline B - Deploy upon successful merge (approved pull request).

My current setup is to trigger pipeline A when a pull request is submitted. This is no problem and works as intended. The issue I am running into is with Pipeline B. It is triggered regardless of whether the PR is approved or even merged. I know that expected behavior for the CI trigger is to fire off with any action on the branch. The PR trigger also doesn't fit my needs though as it would be redundant with Pipeline A.

What I would like to happen is since Pipeline A fires off on PR, a code reviewer will Approve and Merge the PR and only if the PR ends up getting merged into the Release branch is Pipeline B triggered. Is this possible?

  1. Developer completes code.

  2. Developer submits PR against a Release1.0 branch.

  3. Pipeline A triggers. Tests pass or fail.

  4. Code reviewer approves and merges PR into Release1.0 branch.

  5. Pipeline B triggers and deploys.

1

1 Answers

5
votes

UPDATE: For those who bump into the same issue it's actually quite a simple fix. Simply setting the trigger...

pr: none

in Pipeline B will do the trick.