From 5d921a87e9394b5e2a09e8b937c344eb5a251d23 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Wed, 6 Feb 2019 13:47:58 +0100 Subject: [PATCH] [enh] also display commit message --- server.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index 58a92e5..02543a9 100644 --- a/server.py +++ b/server.py @@ -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}")