mirror of
https://github.com/YunoHost/webhooks.git
synced 2024-09-03 19:56:54 +02:00
[enh] handle release event
This commit is contained in:
parent
dd782a2ff4
commit
073f0b118a
1 changed files with 11 additions and 0 deletions
11
server.py
11
server.py
|
@ -273,6 +273,17 @@ async def github(request):
|
||||||
|
|
||||||
notify(f"@{user} {action} repository {repository}{description} {url}")
|
notify(f"@{user} {action} repository {repository}{description} {url}")
|
||||||
|
|
||||||
|
# https://developer.github.com/v3/activity/events/types/#releaseevent
|
||||||
|
elif hook_type == "release":
|
||||||
|
action = request.json["action"]
|
||||||
|
repository = request.json["repository"]["name"]
|
||||||
|
user = request.json["sender"]["login"]
|
||||||
|
url = request.json["release"]["html_url"]
|
||||||
|
release_tag = request.json["release"]["tag_name"]
|
||||||
|
release_title = request.json["release"]["name"]
|
||||||
|
|
||||||
|
notify(f"[repository] @{user} {action} new release #{release_tag} {release_title} {url}")
|
||||||
|
|
||||||
return text("ok")
|
return text("ok")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue