From 5d86db65b948b23cf1b9f85693460b7ea2b65055 Mon Sep 17 00:00:00 2001 From: Tomasz Nguyen Date: Thu, 21 May 2020 19:26:17 +0100 Subject: [PATCH] Respond to issue comments This is the more generic event that gets emitted when people leave comments --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 394954e..dad3693 100644 --- a/index.js +++ b/index.js @@ -7,16 +7,16 @@ async function run() { const github_token = core.getInput('GITHUB_TOKEN'); const context = github.context; - if (context.payload.pull_request == null) { - core.setFailed('No pull request found.'); + if (context.issue.pull_request == null) { + core.setFailed('No issue request found.'); return; } - const pull_request_number = context.payload.pull_request.number; + const issue_number = context.payload.issue.number; const octokit = new github.GitHub(github_token); const new_comment = octokit.issues.createComment({ ...context.repo, - issue_number: pull_request_number, + issue_number: issue_number, body: comment });