mirror of
https://github.com/YunoHost/webhooks.git
synced 2024-09-03 19:56:54 +02:00
[enh] handle fork event
This commit is contained in:
parent
acd9c49e7c
commit
ccfb944a41
1 changed files with 9 additions and 0 deletions
|
@ -105,6 +105,15 @@ async def github(request):
|
||||||
ref = request.json["ref"]
|
ref = request.json["ref"]
|
||||||
notify(f"[{repository}] @{user} deleted {kind} {ref}")
|
notify(f"[{repository}] @{user} deleted {kind} {ref}")
|
||||||
|
|
||||||
|
# https://developer.github.com/v3/activity/events/types/#forkevent
|
||||||
|
elif hook_type == "fork":
|
||||||
|
repository = request.json["repository"]["name"]
|
||||||
|
forked_repository = request.json["forkee"]["full_name"]
|
||||||
|
user = request.json["sender"]["login"]
|
||||||
|
url = request.json["forkee"]["html_url"]
|
||||||
|
|
||||||
|
notify(f"@{user} forked {repository} to {forked_repository} : {url}")
|
||||||
|
|
||||||
return text("ok")
|
return text("ok")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue