mirror of
https://github.com/YunoHost/webhooks.git
synced 2024-09-03 19:56:54 +02:00
[enh] handle branch deletion situation
This commit is contained in:
parent
b58e5b962e
commit
a8147aa21c
1 changed files with 3 additions and 1 deletions
|
@ -79,7 +79,7 @@ async def github(request):
|
||||||
commit_message = commit_message[120:] + "..."
|
commit_message = commit_message[120:] + "..."
|
||||||
|
|
||||||
notify(f"[{repository}] @{user} pushed {len(commits)} commit to {branch}: {commit_message} {url}", repository=repository)
|
notify(f"[{repository}] @{user} pushed {len(commits)} commit to {branch}: {commit_message} {url}", repository=repository)
|
||||||
else:
|
elif len(commits) > 1:
|
||||||
url = request.json["compare"]
|
url = request.json["compare"]
|
||||||
notify(f"[{repository}] @{user} pushed {len(commits)} commits to {branch}: {url}", repository=repository)
|
notify(f"[{repository}] @{user} pushed {len(commits)} commits to {branch}: {url}", repository=repository)
|
||||||
for commit in commits[-5:]:
|
for commit in commits[-5:]:
|
||||||
|
@ -90,6 +90,8 @@ async def github(request):
|
||||||
commit_message = commit_message[120:] + "..."
|
commit_message = commit_message[120:] + "..."
|
||||||
|
|
||||||
notify(f"[{repository}/{branch}] {commit_message} - {author}", repository=repository)
|
notify(f"[{repository}/{branch}] {commit_message} - {author}", repository=repository)
|
||||||
|
else:
|
||||||
|
... # case of 0 which means branch deletion
|
||||||
|
|
||||||
# https://developer.github.com/v3/activity/events/types/#commitcommentevent
|
# https://developer.github.com/v3/activity/events/types/#commitcommentevent
|
||||||
elif hook_type == "commit_comment":
|
elif hook_type == "commit_comment":
|
||||||
|
|
Loading…
Reference in a new issue