我正试图找出一种方法,仅在将pr打开到主控器(即更改即将进入主控器)时运行GitHub工作流。
到目前为止,我到了这一点
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"
}
当我打开将development
分支合并到master
分支中的拉取请求时,我的Install
操作未运行,因为Is Master Branch
返回了
refs / heads / development与refs / heads / master不匹配
答案 0 :(得分:4)
使用新的YAML
语法,您可以这样实现:
on:
pull_request:
branches:
- master
答案 1 :(得分:1)
使用ref代替action "Is Master Branch" {
uses = "actions/bin/filter@master"
args = "ref refs/heads/master"
}
怎么样? (尽管我尚未测试此代码)
export class Ingredient {
constructor(data?: any) {
this.name = data.name;
this.amount = data.amount;
this.measurement = data.measurement;
}
public name: string = null;
public amount: number = null;
public measurement: string = null;
}