简体   繁体   English

如何触发构建管道取决于在 Azure DevOps 中创建 PR 请求源分支

[英]How to Trigger a build pipeline depends on create PR request source branch in Azure DevOps

I have a Develop branch and Master.我有一个开发分支和大师。 My task is to trigger the build pipeline when I create a Pull Request from Develop to Master before merge, depends on Develop branch.我的任务是在合并之前创建从 Develop 到 Master 的 Pull Request 时触发构建管道,这取决于 Develop 分支。 The trigger should be from source branch.触发器应该来自源分支。 Can we add tags to trigger the build pipeline based on source branch.我们可以添加标签来触发基于源分支的构建管道吗? I am using classic pipelines and new to ADO.我正在使用经典管道和 ADO 的新手。 how can I achieve this.我怎样才能做到这一点。 Please someone help me to achieve this in detail.请有人帮我详细实现这一目标。

To get a pipeline to trigger when a PR is opened but before it is merged you would need to add a branch policy on master branch to have a build validation step.要在 PR 打开但在合并之前触发管道,您需要在主分支上添加分支策略以进行构建验证步骤。 This will trigger the pipeline to run whenever a PR is opened to master每当 PR 向 master 开放时,这将触发管道运行

Build Validation 构建验证

Unfortunately, PR trigger behaviour varies, depending on which SCM you're using: Azure Repos Git, GitHub, or Bitbucket Cloud.不幸的是,PR 触发行为会有所不同,具体取决于您使用的 SCM:Azure Repos Git、GitHub 或 Cloud。 With BB Cloud, the PR build will be triggered when the PR is opened or updated, but not when it is merged.使用 BB Cloud,PR 构建将在 PR 打开或更新时触发,但在合并时不会触发。 The filter input can be used to specify branches for PR trigger.过滤器输入可用于指定 PR 触发的分支。

Details for each SCM system can be found by clicking on the links on the " Triggers in Azure Pipelines " documentation.通过单击“ Azure 管道中的触发器”文档中的链接,可以找到每个 SCM 系统的详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure DevOps - 管道不应触发 PR 构建 - Azure DevOps - Pipeline should not trigger build for PR Azure Devops 构建管道:当 PR 没有附加任何工作项时,CI 触发器无法在 PR 合并到分支 - Azure Devops build pipeline: CI triggers not working on PR merge to a branch when there is no work item is attached with the PR 如何区分 azure DevOps 构建管道中的分支触发器和计划触发器 - How to differentiate between branch trigger and the scheduled trigger in azure DevOps build pipeline Azure devops:在不同存储库的分支上构建管道触发器 CI - Azure devops: Pipeline Trigger CI build on branch in different repositories Azure devops 构建管道依赖于其他构建管道 - Azure devops build pipeline depends on other build pipeline 如何从 azure devops 中的另一个构建管道触发构建 - How to trigger a build from another build pipeline in azure devops 从 azure devops 构建成功后如何使用脚本或管道触发拉取请求 - How to Trigger a pull request using script or pipeline once build is successful from azure devops GitHub PR 合并不会触发 Azure DevOps Pipeline - GitHub PR Merge does not trigger Azure DevOps Pipeline 如何在Azure DevOps构建管道中排除一个分支 - How to exclude one branch in Azure DevOps build pipeline 如何根据提交消息触发 azure devops build pipeline? - How to trigger azure devops build pipeline based on the commit message?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM