diff --git a/app.js b/app.js index 2f8afc4..9d9bdfe 100644 --- a/app.js +++ b/app.js @@ -219,7 +219,7 @@ module.exports = (app) => { await context.octokit.rest.issues.addLabels({ owner: context.payload.repository.owner.login, repo: context.payload.repository.name, - issue_number: context.payload.pull_request.number, + issue_number: context.payload.issue.number, labels: [emergencyLabel] }).then(response => { console.log(`${emergencyLabel} label applied to PR: ${context.payload.issue.pull_request.html_url}`); diff --git a/test.js b/test.js index 9434cd9..b520d7c 100644 --- a/test.js +++ b/test.js @@ -111,7 +111,8 @@ const payloadPrComment = { url: "https://api.github.com/repos/robandpdx/superbigmono/issues/1", pull_request: { html_url: "https://github.com/robandpdx/superbigmono/pull/1" - } + }, + number: 1, }, comment: { body: "We need an Emergency landing - this bug is critical!"