Sep 12 2024 05:17 AM - edited Sep 12 2024 05:18 AM
Hi,
I have a situation in which when a PR is opened (code is still on a feature branch at this point), a pipeline ('Source pipeline)' runs which does a build and triggers a seperate test pipeline ('Triggered' pipeline) if the build is successful. The yaml files for both the Triggered pipeline and Source pipeline are on the same branch ('Integration')
resources:
pipelines:
- pipeline: 'Triggered pipeline'
source: 'Source pipeline'
trigger:
branches:
include:
- '*'
exclude:
- 'Integration'
I tried to do this initially on the triggered pipeline, through the Triggers GUI (Add the Build completion option, set the triggering build (which in this case would be the Source pipeline) and set the branch filters to exclude 'Integration' branch. This didn't work. (I would have assumed that as long as the Source pipeline finished running successfully for any branch other than Integration, that my triggered pipeline would then run). The behaviour it currently exhibits is only after the PR was reviewed and approved, and the code, from the feature branch, merged into Integration, the test pipeline would trigger successfully after the Source pipeline had been manually triggered which is not what I want.
I added the above code into my Triggered pipeline yaml code thinking that this would overwrite the settings of the GUI and trigger the test pipeline correctly however that didn't work either.
How do I configure my test pipeline to run once the source pipeline has successfully built the code in a feature branch for a PR ?
I'm using the Azure Pipelines component of Azure DevOps.
Many thanks