[enh] handle release event

This commit is contained in:
Laurent Peuch 2019-02-06 13:26:08 +01:00
parent dd782a2ff4
commit 073f0b118a

View file

@ -273,6 +273,17 @@ async def github(request):
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")