[英]Only run GitHub actions if pr target is master
I am trying to figure out a way how to run GitHub workflow only when pr is opened into master ie changes are going into master. 我试图找出一种方法,仅当pr打开master时才运行GitHub工作流,即更改即将进入master。
So far I got to this point 到目前为止,我到了这一点
workflow "Install Yarn Dependencies" {
on = "pull_request"
resolves = ["Install"]
}
action "Is Master Branch" {
uses = "actions/bin/filter@master"
args = "branch master"
}
action "Install" {
needs = "Is Master Branch"
uses = "nuxt/actions-yarn@master"
args = "install"
}
When I open pull request merging development
branch into master
branch my Install
action is not ran, because Is Master Branch
returns 当我打开将
development
分支合并到master
分支的拉请求时,我的Install
操作未运行,因为Is Master Branch
返回了
refs/heads/development does not match refs/heads/master
裁判/负责人/发展与裁判/负责人/大师不匹配
With the new YAML
syntax, you can achieve this like so: 使用新的
YAML
语法,您可以这样实现:
on:
pull_request:
branches:
- master
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.