最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Azure Devops Pipeline trigger from a different repo does not work - Stack Overflow

programmeradmin1浏览0评论

So this my code following the guidelines in the docs:

trigger: 
- none
resources:
  repositories: 
  - repository: test-repo
    type: git
    name: test-project/test-repo
    ref: testname
    trigger:
      branches:
        include: 
        - testname

No matter what I do, pushing code to my test repo just does not trigger the pipeline. Already disables:

  • Limit job authorization scope to current project for non-release pipelines: tho not sure if this actually does anything
  • The pipeline is linked to the repo (Pipeline permissions section)

What Azure magic do I have to configure for it actually work? Please someone enlighten me.

So this my code following the guidelines in the docs:

trigger: 
- none
resources:
  repositories: 
  - repository: test-repo
    type: git
    name: test-project/test-repo
    ref: testname
    trigger:
      branches:
        include: 
        - testname

No matter what I do, pushing code to my test repo just does not trigger the pipeline. Already disables:

  • Limit job authorization scope to current project for non-release pipelines: tho not sure if this actually does anything
  • The pipeline is linked to the repo (Pipeline permissions section)

What Azure magic do I have to configure for it actually work? Please someone enlighten me.

Share Improve this question asked Feb 5 at 19:47 BennimiBennimi 5142 gold badges7 silver badges22 bronze badges 7
  • Are the repositories in the same project? Is either pipeline new and only exists in one branch? – bryanbcook Commented Feb 5 at 20:32
  • Everything is in one repo, the pipeline reference the branch it is currently running on – Bennimi Commented Feb 5 at 20:42
  • 1 Let me re-phrase: for the pipeline outlined above, is this an existing pipeline that has already been merged down into your main branch or is it brand-new and only exists in the current branch? – bryanbcook Commented Feb 5 at 22:37
  • It is not on main, but I have changed the settings of the pipeline to use my current branch as default – Bennimi Commented Feb 5 at 22:49
  • 1 @bryanbcook your hunch was correct, apparently, even with changing the branch for the pipeline, it does not work correctly, pushed the code to main, and it magically did. – Bennimi Commented Feb 6 at 9:52
 |  Show 2 more comments

1 Answer 1

Reset to default 2

According to the trigger document,

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.

You mentioned:

I have changed the settings of the pipeline to use my current branch as default.

If you mean that you changed the Default branch for manual and scheduled builds of the pipeline as shown in the screenshot, this is not the default branch of the repository but the default branch of the pipeline.

We need to ensure that the default branch of your repository contains the YAML file of this pipeline. You can either set the current branch as the default branch of your repository or merge the current branch into the default branch.

To set a new default branch, on the Branches page, select More options next to the new default branch you want, and choose Set as default branch.

发布评论

评论列表(0)

  1. 暂无评论