'Azure DevOps trigger at pipeline completion using different branch than expected
In the workflow of a pipeline triggering another pipeline according to this doc, I'm trying to set:
- feature-branch PR to develop-branch triggers stage-ci
- stage-ci runs, triggers stage-cd
- pipeline stage-cd runs
But in step 3, it gets the default branch, not the feature-branch.
Does anyone know why this is happening? When the trigger in stace-ci is trigger (not pr) it works fine
stage-ci.yaml:
trigger: none
pr:
branches:
include:
- develop
stage-cd.yaml
trigger: none
pr: none
resources:
pipelines:
- pipeline: stage-ci
source: stage-ci
trigger: true
Solution 1:[1]
Refer to the documentation. pr only works for repositories hosted in GitHub or BitBucket. For PR triggers on Azure DevOps-hosted repositories, you should use a branch policy with a required pipeline run.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Daniel Mann |

