in triage-actions/common/Action.ts [19:62]
public async run() {
try {
const token = getRequiredInput('token')
const readonly = !/^(false|0)?$/i.test(getInput('readonly'))
const issue = context?.issue?.number
if (issue) {
const octokit = new OctoKitIssue(token, context.repo, { number: issue }, { readonly })
if (context.eventName === 'issue_comment') {
await this.onCommented(octokit, context.payload.comment.body, context.actor)
} else if (context.eventName === 'issues') {
switch (context.payload.action) {
case 'opened':
await this.onOpened(octokit)
break
case 'reopened':
await this.onReopened(octokit)
break
case 'closed':
await this.onClosed(octokit)
break
case 'labeled':
await this.onLabeled(octokit, context.payload.label.name)
break
case 'unassigned':
await this.onUnassigned(octokit, context.payload.assignee.login)
break
case 'edited':
await this.onEdited(octokit)
break
case 'milestoned':
await this.onMilestoned(octokit)
break
default:
throw Error('Unexpected action: ' + context.payload.action)
}
}
} else {
await this.onTriggered(new OctoKit(token, context.repo, { readonly }))
}
} catch (e) {
setFailed(e.message)
}
}