auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
// validate that an issue title was submitted for the event
if (typeof event.body.title === 'undefined') {
console.error(`Expected JSON body with { "title": "YOUR-ISSUE-TITLE" }`)
throw `Issue title is missing`
}
Name of repository owner.
Name of repository.
async
(params, auths) => {
}
const data = {
assignee: params.assignee,
body: params.body,
labels: params.labels,
milestone: params.milestone,
title: params.title,
}
try {
return (await require("axios")({
method: "post",
url: `https://api.github.com/repos/${params.owner}/${params.repo}/issues`,
headers: {
Authorization: `Bearer ${auths.github.oauth_access_token}`,
},
data,
})).data
} catch (err) {
this.err = err
throw err
}