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