From 602523c1e8cb03e286b70b356c117a8062437edc Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Wed, 6 Feb 2019 13:16:20 +0100 Subject: [PATCH] [fix] maximize commit message len + remove endl --- server.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index 86a2d44..f3ae524 100644 --- a/server.py +++ b/server.py @@ -67,7 +67,11 @@ async def github(request): notify(f"[{repository}] @{user} pushed {len(commits)} commits to {branch}: {url}") for commit in commits[-5:]: 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}") # https://developer.github.com/v3/activity/events/types/#commitcommentevent