Skip to content

Commit

Permalink
rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-z committed Apr 2, 2020
1 parent 59ef047 commit 524237d
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 4,986 deletions.
8 changes: 4 additions & 4 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ function run() {
const message = core.getInput('message');
const github_token = core.getInput('GITHUB_TOKEN');
const context = github.context;
if (context.payload.pull_request == null) {
core.setFailed('Not linked to a pull request');
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(Object.assign(Object.assign({}, context.repo), { issue_number: pull_request_number, body: message }));
const new_comment = octokit.issues.createComment(Object.assign(Object.assign({}, context.repo), { issue_number: issue_number, body: message }));
}
catch (error) {
core.setFailed(error.message);
Expand Down
Loading

0 comments on commit 524237d

Please sign in to comment.