I have two repositories and both are in same project of ADO:
one is at the top level (It also include pipeline yaml), and the other is defined as a submodule. I want to trigger a pipeline whenever an update is pushed to either the main repository or any of the repositories declared as resources(submodule mentioned here).
I tried below code but it only trigger on changes in self or if i run manually.
trigger:
- main
pool:
name: 'myselfhostedagent'
resources:
repositories:
- repository: sub_repo
type: git
name: test/sub_repo
ref: master
trigger:
- master
steps:
- checkout: self
- checkout: sub_repo
- script: |
echo $(Build.Repository.Name)
echo $(Build.SourceBranch)
dir $(Build.SourcesDirectory)
Troubleshooting:
- I defined self trigger to none but no success
- I created pipeline in sub_repo and it getting trigger properly
- As per docs
“If a change to any other repository resource triggers the pipeline, then the latest version of YAML from the default branch of self repository is used.”
I verified that my self repo has defined main as default branch.
Any tips to resolve this or any way to verify from logs that as soon as i do push in sub_repo how AzureDevOps handle it.