From dfd90aaf2129011b0aa6d2b3ca5298e4a49a0306 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Wed, 6 Feb 2019 11:51:58 +0100 Subject: [PATCH] [enh] handle issue_comment --- server.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/server.py b/server.py index dc7a20f..e6c35ad 100644 --- a/server.py +++ b/server.py @@ -114,6 +114,19 @@ async def github(request): notify(f"@{user} forked {repository} to {forked_repository} : {url}") + # https://developer.github.com/v3/activity/events/types/#issuecommentevent + elif hook_type == "issue_comment": + repository = request.json["repository"]["name"] + user = request.json["sender"]["login"] + url = request.json["comment"]["html_url"] + issue_number = request.json["issue"]["number"] + comment = request.json["comment"]["body"] + + if len(comment) > 120: + comment = comment[:120] + "..." + + notify(f"[{repository}] @{user} commented on issue #{issue_number}: {comment} {url}") + return text("ok")