From 3415a9f8c03fb75b3b230dee37021c6da501d2c6 Mon Sep 17 00:00:00 2001 From: Rob Anderson Date: Fri, 27 Oct 2023 16:14:02 -0600 Subject: [PATCH] fix issue comment created (#80) --- app.js | 2 +- test.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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!"