[enh] handle delete event

This commit is contained in:
Laurent Peuch 2019-02-06 01:23:33 +01:00
parent dcf46ebd0e
commit 8ea6e12299

View file

@ -96,6 +96,15 @@ async def github(request):
else:
print(f"WARNING: unknown 'create' even kind: {kind}")
# https://developer.github.com/v3/activity/events/types/#createevent
elif hook_type == "delete":
kind = request.json["ref_type"]
user = request.json["sender"]["login"]
repository = request.json["repository"]["name"]
ref = request.json["ref"]
notify(f"[{repository}] @{user} deleted {kind} {ref}")
return text("ok")