mirror of
https://github.com/YunoHost/webhooks.git
synced 2024-09-03 19:56:54 +02:00
[enh] handle issue_comment
This commit is contained in:
parent
ccfb944a41
commit
dfd90aaf21
1 changed files with 13 additions and 0 deletions
13
server.py
13
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")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue