mirror of
https://github.com/YunoHost/webhooks.git
synced 2024-09-03 19:56:54 +02:00
[enh] handle commit_comment
This commit is contained in:
parent
84cce522e1
commit
acf2c52d7f
1 changed files with 9 additions and 0 deletions
|
@ -66,6 +66,15 @@ async def github(request):
|
||||||
commit_message = commit["message"]
|
commit_message = commit["message"]
|
||||||
notify(f"[{repository}/{branch}] {commit_message} - {author}")
|
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")
|
return text("ok")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue