Skip to content

Commit

Permalink
pr->issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-z authored Apr 2, 2020
1 parent 1f25fab commit fe74061
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main.ts
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.payload.issue == null) {
core.setFailed('No issue 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: message
});

Expand Down

0 comments on commit fe74061

Please sign in to comment.