Is it possible to have a yaml pipeline trigger on commits/PRs for branches of different repositories (e.g. Repo A) to the one the azure-pipelines.yaml file is in (e.g. Repo B)?
I'm aware I can build the pipeline against Repo B and have it checkout Repo A using e.g:
resources:
repositories:
- repository: Repo A
type: github
endpoint: ***
name: ***/RepoA
trigger:
- master
But the trigger is only applying to Repo B, i.e. when I make a commit on master to Repo A, the pipeline does not trigger.
The "Sprint 173" release seems to be including the multi-repo triggers feature. I suspect you might be missing the ref.
Here is an example that shows how to define multiple repository resources in a pipeline and how to configure triggers on all of them.
trigger: - main resources: repositories: - repository: tools type: git name: MyProject/tools ref: main trigger: branches: include: - main - release
The pipeline in this example will be triggered if there are any updates to:
main
branch in theself
repo containing the YAML filemain
orrelease
branches in tools repo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With