[enh] handle commit_comment

This commit is contained in:
Laurent Peuch 2019-02-06 00:52:50 +01:00
parent 84cce522e1
commit acf2c52d7f

View file

@ -66,6 +66,15 @@ async def github(request):
commit_message = commit["message"]
notify(f"[{repository}/{branch}] {commit_message} - {author}")
# https://developer.github.com/v3/activity/events/types/#commitcommentevent
elif hook_type == "commit_comment":
repository = request.json["repository"]["name"]
user = request.json["comment"]["user"]["login"]
commit_short_id = request.json["comment"]["commit_id"][:7]
comment = request.json["comment"]["body"]
notify(f"[{repository}] @{user} comment on commit {commit_short_id}: {comment} {url}")
return text("ok")