有没有办法在 Azure DevOps 中将 PR 从特定分支限制到另一个分支

Is there a way to restrict PRs from a specific branch to another in Azure DevOps

我正在尝试找到一种方法来限制从 feature/xxxxrelease/xxxxx 开头的 PR 创建(或者以更简单的方式,从 feature 分支到 release 分支)在 Azure DevOps 中。解决方法可能是过滤分支策略的构建验证中的路径,如针对 yaml 管道提到的 here, but it needs a build pipeline for this. Is there any other way that this can be done? I know about these two predefined variables in Azure DevOps: System.PullRequest.TargetBranch, System.PullRequest.SourceBranch but then again these are only available。我对此很陌生。有人可以帮忙吗?

很遗憾,没有限制 PR 的权限。唯一的方法是设置 branch policies 来保护目标分支。您可以使用您提到的解决方法,或者您可以为受影响的路径添加所需的审阅者: