Skip to content

Commit

Permalink
Respond to issue comments
Browse files Browse the repository at this point in the history
This is the more generic event that gets emitted when people leave comments
  • Loading branch information
swist authored May 21, 2020
1 parent 0e7184d commit 5d86db6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});

Expand Down

0 comments on commit 5d86db6

Please sign in to comment.