mirror of
https://github.com/YunoHost/webhooks.git
synced 2024-09-03 19:56:54 +02:00
[enh] also display commit message
This commit is contained in:
parent
df38ce695f
commit
5d921a87e9
1 changed files with 6 additions and 1 deletions
|
@ -61,7 +61,12 @@ async def github(request):
|
||||||
|
|
||||||
if len(commits) == 1:
|
if len(commits) == 1:
|
||||||
url = commits[0]["url"]
|
url = commits[0]["url"]
|
||||||
notify(f"[{repository}] @{user} pushed {len(commits)} commit to {branch}: {url}")
|
commit_message = commits[0]["message"].replace("\r\n", " ")
|
||||||
|
|
||||||
|
if len(commit_message) > 120:
|
||||||
|
commit_message = commit_message[120:] + "..."
|
||||||
|
|
||||||
|
notify(f"[{repository}] @{user} pushed {len(commits)} commit to {branch}: {commit_message} {url}")
|
||||||
else:
|
else:
|
||||||
url = request.json["compare"]
|
url = request.json["compare"]
|
||||||
notify(f"[{repository}] @{user} pushed {len(commits)} commits to {branch}: {url}")
|
notify(f"[{repository}] @{user} pushed {len(commits)} commits to {branch}: {url}")
|
||||||
|
|
Loading…
Reference in a new issue