[enh] also display commit message

This commit is contained in:
Laurent Peuch 2019-02-06 13:47:58 +01:00
parent df38ce695f
commit 5d921a87e9

View file

@ -61,7 +61,12 @@ async def github(request):
if len(commits) == 1:
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:
url = request.json["compare"]
notify(f"[{repository}] @{user} pushed {len(commits)} commits to {branch}: {url}")