EN VI

Azure-devops - Trigger Azure DevOps pipeline to run only when PR is raised?

2024-03-11 01:30:05
Azure-devops - Trigger Azure DevOps pipeline to run only when PR is raised

I want my pipeline to run only when a PR is raised from any source branch to the develop branch. I do not want anything to run after the PR is merged.

This is what I have:

trigger: none

pr:
  branches:
    include:
    - develop

However, with this, nothing runs when I raise a PR from a source branch to develop...

Solution:

You can achieve that for your develop branch by configuring branch policies! You have build validation part where you specify the rule and select yaml file to be executed when PR is created on that branch.

You can find everything on official documentation.

Answer

Login


Forgot Your Password?

Create Account


Lost your password? Please enter your email address. You will receive a link to create a new password.

Reset Password

Back to login