Skip to content

Commit

Permalink
main.js: Add PullRequestReview and PullRequestReviewComment event
Browse files Browse the repository at this point in the history
Fixes #6
  • Loading branch information
ayan-b committed Dec 24, 2018
1 parent f45e174 commit 51442ac
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,21 @@ $(document).ready(function(){
"/commit/" + activity.payload.pull_request.head.sha + '">' + activity.payload.pull_request.head.sha.substring(0, 10) +
"</a> " + activity.payload.pull_request.title + "</blockquote>";
break;
case "PullRequestReviewEvent":
action = activity.payload.action;
url = activity.payload.pull_request.html_url;
body = activity.payload.pull_request.title;
show = user + ' ' + action + ' review on pull request:<a target="_blank" href='
+ url + '</a> ' + body;
break;
case "PullRequestReviewCommentEvent":
action = activity.payload.action;
url = activity.payload.pull_request.html_url;
diff = activity.payload.comment.diff_hunk;
body = '<code>' + diff + '</code><br>' + activity.payload.comment.body;
show = user + ' ' + action + ' review on pull request:' + '<a target="_blank" href=' +
url + '> ' + activity.payload.pull_request.title + '</a>' + '<blockquote>' +
body + '</blockquote>';
break;
case "PushEvent":
ref = activity.payload.ref.replace(/^.*\/(.*)$/, "$1"),
Expand Down

0 comments on commit 51442ac

Please sign in to comment.