【发布时间】:2019-08-05 17:43:16
【问题描述】:
比如我在当前仓库中有五个分支,它们的名字分别是:master、branch1、branch2、branch3、branch4。使用用于 probot 构建的 typescript 语言来获取这些名称。
我尝试过的:
import { Application } from 'probot'
export = (app: Application) => {
app.on(`*`, async context => {
var branchName = context.github.repos.listBranches.name
var branchName1 = context.github.repos.getBranch.name
var branchName2 = context.payload.Status.branches.name
console.log(branchName + "\n")
// result: bound apiMethod
console.log(branchName1 + "\n")
// result: bound apiMethod
console.log(branchName2 + "\n")
// result: ERROR event: Cannot read property 'branches' of undefined
})
}
请解释一下bound apiMethod在这里的含义。
谢谢!
【问题讨论】:
标签: git typescript github probot