用管道资源手动触发DevOps管道应使用该分支的最新资源管道运行
我在相同的存储库中有2个管道:
- 构建
- 部署
构建管道被声明为部署管道中的管道资源:
resources:
pipelines:
- pipeline: Build
source: BuildPipelineName
trigger: true
当我运行构建管道时,在同一分支上正确触发了部署管道。但是,当我手动运行部署管道时,它不会使用同一分支运行的最新管道。
我尝试将下面的几行变体添加到管道资源中,但是变量没有扩展:
branch: ${{ variables.Build.SourceBranchName }}
有什么方法可以使此工作?
I have 2 pipelines in the same repo:
- Build
- Deploy
The Build pipeline is declared as a pipeline resource in the Deploy pipeline:
resources:
pipelines:
- pipeline: Build
source: BuildPipelineName
trigger: true
When I run the Build pipeline, the Deploy pipeline is correctly triggered on the same branch. However, when I run the Deploy pipeline manually, it does not use the latest pipeline run from same branch.
I tried adding a couple of variations of the line below to the to the pipeline resource, but the variable does not expand:
branch: ${{ variables.Build.SourceBranchName }}
Is there any way to make this work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
解决方法可以实现我想要的结果,但不是很优雅:
Workaround that achieves the result I am looking for, but is not very elegant:
这对我有用:
This works for me:
例如,如果我有一个名为“ build Pipileaneanddeploypipeline”的构建管道,
那么以下YAML定义可以从特定分支机构中运行最新的构建管道:
For example, if I have a build pipeline named 'BuildPipelineAndDeployPipeline',
then the below YAML definition can get the latest build pipeline run from a specific branch: