Reputation: 1
I have a pipeline and the yaml file is in a repo called Pipelines. I want to trigger it when another repo, assumed RepoA, is updated. I have review the document from here:
Check out multiple repositories in your pipeline
According to the example in the document above, I build my pipeline as the code below:
# YAML: Pipelines/test-pipeline.yml
trigger:
- develop
resources:
repositories:
- repository: A
type: git
name: RepoA
ref: main
trigger:
- main
- develop
steps:
- checkout: self
- checkout: A
and I assume the pipeline would work as this circomstance:
Change made to | Pipeline triggered | Version of YAML | Version of self | Version of A |
---|---|---|---|---|
develop in self |
Yes | commit from develop that triggered the pipeline |
commit from develop that triggered the pipeline |
latest from main |
main in A |
Yes | latest from main |
latest from main |
commit from main that triggered the pipeline |
develop in A |
Yes | latest from main |
latest from main |
commit from develop that triggered the pipeline |
However, the truth is the update in RepoA would not fire the pipeline. Did I miss something in the rules of pipeline or project settings?
trigger:
- develop
resources:
repositories:
- repository: A
type: git
name: MyProject/RepoA
ref: main
trigger:
- main
- develop
steps:
- checkout: self
- checkout: A
not work (p.s. Repo Pipelines and RepoA are under the same project)
not work
trigger:
- develop
resources:
repositories:
- repository: A
type: git
name: MyProject/RepoA
ref: main
trigger:
branches:
include:
- main
- develop
steps:
- checkout: self
- checkout: A
not work
Upvotes: 0
Views: 598
Reputation: 8468
I used your first yaml, and repository trigger works(test1 as repo A):
Please follow below steps:
Change the develop
branch as default branch in the repo.
If the pipeline didn't run before, please manually run it for one time.
Then commit on repo A to check the trigger(PS: if repo A is in same project, use name: RepoA
in yaml for trigger, without project.)
Edit:
Add my yaml:
trigger:
- dev5
pool:
vmImage: ubuntu-latest
resources:
repositories:
- repository: A
type: git
name: test1
ref: main
trigger:
- main
- develop
steps:
- checkout: self
- checkout: A
Upvotes: 0