admin管理员组文章数量:1395730
I am following this documentation pipeline trigger one after another and configured the triggering pipeline as below to the main.Please note that all the below .yaml configuration are available in master branch.
I am referring testsign as pipeline A here:
Pipeline B:
resources:
pipelines:
- pipeline: test
source: testsign #source pipeline
trigger:
branches:
include:
- master
- user/*
The changes are working as expected when I triggered any feature branch source pipeline manually followed by automatic build of the triggering pipeline.
Now, I went further to configure the same for every PR. so, that 1st pipeline runs build & second runs the tests on hosted agents using the source pipeline artifacts.
For this, I set up the branch policy of Master branch to run source pipeline(testsign) automatically for every PR, assuming that pipeline B will be triggered after completion of A. While it successfully triggered pipeline A, but pipeline B never triggered.
I also, went with another approach adding the PR trigger in pipeline B.But, it did not work either.
trigger: none
pr:
branches:
include:
- master
- user/*
resources:
pipelines:
- pipeline: test
source: testsign
trigger:
branches:
include:
- master
- user/*
Is it actually possible to use resource pipeline trigger for every PR? if yes, please let me know, if there is any misconfiguration I made here. Thanks!
I am following this documentation pipeline trigger one after another and configured the triggering pipeline as below to the main.Please note that all the below .yaml configuration are available in master branch.
I am referring testsign as pipeline A here:
Pipeline B:
resources:
pipelines:
- pipeline: test
source: testsign #source pipeline
trigger:
branches:
include:
- master
- user/*
The changes are working as expected when I triggered any feature branch source pipeline manually followed by automatic build of the triggering pipeline.
Now, I went further to configure the same for every PR. so, that 1st pipeline runs build & second runs the tests on hosted agents using the source pipeline artifacts.
For this, I set up the branch policy of Master branch to run source pipeline(testsign) automatically for every PR, assuming that pipeline B will be triggered after completion of A. While it successfully triggered pipeline A, but pipeline B never triggered.
I also, went with another approach adding the PR trigger in pipeline B.But, it did not work either.
trigger: none
pr:
branches:
include:
- master
- user/*
resources:
pipelines:
- pipeline: test
source: testsign
trigger:
branches:
include:
- master
- user/*
Is it actually possible to use resource pipeline trigger for every PR? if yes, please let me know, if there is any misconfiguration I made here. Thanks!
Share Improve this question asked Mar 27 at 1:38 shravyashravya 334 bronze badges 1 |1 Answer
Reset to default 1You can include
the branches refs/pull/*
as part of the pipeline resource trigger
in Pipeline B.
resources:
pipelines:
- pipeline: test
source: testsign
trigger:
branches:
include:
- master
- user/*
- refs/pull/*
When the pipeline testsign
was triggered by a PR (with Build Validation branch policies set for Azure Repos), the value of $(Build.SourceBranch)
was refs/pull/<prId>/merge
, which was an intermediate branch between the PR source and target branches. Apparently in the current YAML definition from master
branch of your pipeline B, that pipeline resource didn't include
such branches in the trigger
property.
Besides, please note that YAML pr
triggers are supported only in GitHub and Bitbucket Cloud but not used for Azure Repos.
本文标签: azure devopsPipeline Resource trigger for every PRStack Overflow
版权声明:本文标题:azure devops - Pipeline Resource trigger for every PR - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744117506a2591582.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
refs/pull/*
branches? Hope it may help resolve the issue in this post. Thx for the update and wish you a lovely weekend. – Alvin Zhao - MSFT Commented Mar 28 at 2:14