mirror of
https://github.com/YunoHost/webhooks.git
synced 2024-09-03 19:56:54 +02:00
[enh] handle repository event
This commit is contained in:
parent
d7759db911
commit
dd782a2ff4
1 changed files with 15 additions and 0 deletions
15
server.py
15
server.py
|
@ -258,6 +258,21 @@ async def github(request):
|
|||
else:
|
||||
notify(f"WARNING: unknown 'pull_requests' action: {action}")
|
||||
|
||||
# https://developer.github.com/v3/activity/events/types/#repositoryevent
|
||||
elif hook_type == "repository":
|
||||
action = request.json["action"]
|
||||
repository = request.json["repository"]["name"]
|
||||
user = request.json["sender"]["login"]
|
||||
url = request.json["repository"]["html_url"]
|
||||
description = request.json["repository"]["description"]
|
||||
|
||||
if not description:
|
||||
description = ""
|
||||
else:
|
||||
description = ": " + description
|
||||
|
||||
notify(f"@{user} {action} repository {repository}{description} {url}")
|
||||
|
||||
return text("ok")
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue