只有在YAML提出拉动请求时,我才能运行一个舞台
我正在学习yaml,并希望在特定分支上提出拉请请求时才能运行一个阶段。我该怎么做?
Im learning YAML and want a stage to run only when a PULL Request has been made on a particular branch. How can i do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要仅在特定分支上提出拉请请求时运行阶段,您可以在舞台上设置条件。
以下是一个示例:
您可以使用预定义的变量:
system.pullrequest.targetBranch
和build.Reason
来过滤触发方法并拉请求目标分支。有关更多详细信息,您可以参考文档:条件和预定义变量。
To run a stage only when a pull request has been made on a particular branch, you can set the condition in the stage.
Here is an example:
You can use predefined variables:
System.PullRequest.TargetBranch
andBuild.Reason
to filter the trigger method and pull request target branch.For more detailed info, you can refer to the docs: Condition and Predefined variables.