RedditPP Mascot

RedditPP

r/azuredevops • … • u/panzerbjrn

How to only allow PRs if pipelines X & Y both run green?

Can anyone point me towards either documentation or videos describing how to automatically reject a PR into a specific branch unless certain specific pipelines run green?

Basically, we have had some instances where code has not been properly tested before a PR was done, and we've had to revert the changes afterwards. I don't really know for sure if what I want is really possible. Ideally I'd like when someone raises a PR, Pipelines X & Y are run against the code in the PR, and if the pipeline completes successfully or with a warning, the PR can go ahead, and if the pipeline fails, then it automatically rejects. These are YAML Terraform Pipelines, and the branch the pipeline uses is stated in a YAML file. Is this possible?

And if so, where can I read up on it? I must be searching for something now quite right, because I can't really find anything on this.

— 0