mirror of
https://github.com/YunoHost/webhooks.git
synced 2024-09-03 19:56:54 +02:00
[enh] handle pull_request_review_comment event
This commit is contained in:
parent
d9122dc71f
commit
ee65ffe25e
1 changed files with 14 additions and 0 deletions
14
server.py
14
server.py
|
@ -179,6 +179,20 @@ async def github(request):
|
||||||
|
|
||||||
notify(f"[{repository}] @{user} {action} milestone {milestone}")
|
notify(f"[{repository}] @{user} {action} milestone {milestone}")
|
||||||
|
|
||||||
|
# https://developer.github.com/v3/activity/events/types/#pullrequestreviewcommentevent
|
||||||
|
elif hook_type == "pull_request_review_comment":
|
||||||
|
action = request.json["action"]
|
||||||
|
repository = request.json["repository"]["name"]
|
||||||
|
user = request.json["sender"]["login"]
|
||||||
|
pull_request_number = request.json["pull_request"]["number"]
|
||||||
|
comment = request.json["comment"]["body"]
|
||||||
|
url = request.json["comment"]["html_url"]
|
||||||
|
|
||||||
|
if len(comment) > 120:
|
||||||
|
comment = comment[:120] + "..."
|
||||||
|
|
||||||
|
notify(f"[{repository}] @{user} {action} a comment on pull request #{pull_request_number}: {comment} {url}")
|
||||||
|
|
||||||
return text("ok")
|
return text("ok")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue