mirror of
https://github.com/YunoHost/webhooks.git
synced 2024-09-03 19:56:54 +02:00
[fix] maximize commit message len + remove endl
This commit is contained in:
parent
2642c4f5f8
commit
602523c1e8
1 changed files with 5 additions and 1 deletions
|
@ -67,7 +67,11 @@ async def github(request):
|
||||||
notify(f"[{repository}] @{user} pushed {len(commits)} commits to {branch}: {url}")
|
notify(f"[{repository}] @{user} pushed {len(commits)} commits to {branch}: {url}")
|
||||||
for commit in commits[-5:]:
|
for commit in commits[-5:]:
|
||||||
author = commit["author"]["name"]
|
author = commit["author"]["name"]
|
||||||
commit_message = commit["message"]
|
commit_message = commit["message"].replace("\n", " ")
|
||||||
|
|
||||||
|
if len(commit_message) > 120:
|
||||||
|
commit_message = commit_message[120:] + "..."
|
||||||
|
|
||||||
notify(f"[{repository}/{branch}] {commit_message} - {author}")
|
notify(f"[{repository}/{branch}] {commit_message} - {author}")
|
||||||
|
|
||||||
# https://developer.github.com/v3/activity/events/types/#commitcommentevent
|
# https://developer.github.com/v3/activity/events/types/#commitcommentevent
|
||||||
|
|
Loading…
Reference in a new issue