For instance, imagine I have five different branches within the current repository: master, branch1, branch2, branch3, and branch4. How can we use TypeScript for a Probot build to access these branch names?
My Attempt:
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")
// output: bound apiMethod
console.log(branchName1 + "\n")
// output: bound apiMethod
console.log(branchName2 + "\n")
// error message: ERROR event: Cannot read property 'branches' of undefined
})
}
Please also provide an explanation of what is meant by bound apiMethod
.
Appreciate your help!