From 4730e66f15ff7ababe795f1283f1a851b66958d2 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 20 Jan 2023 12:45:09 +0100 Subject: [PATCH] Simplify push messages --- server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 2d1e56b..748907f 100644 --- a/server.py +++ b/server.py @@ -102,14 +102,16 @@ async def github(request): if len(commit_message) > 120: commit_message = commit_message[:120] + "..." + commit_id = url.split("/")[-1] await notify( - f"[{repository}] @{user} pushed {len(commits)} commit to {branch}: {commit_message} {url}", + f"[{repository}] @{user} pushed {len(commits)} commit to {branch}: {commit_message} ([{commit_id}]({url}))", repository=repository, ) elif len(commits) > 1: url = request.json["compare"] + commit_ids = url.split("/")[-1] await notify( - f"[{repository}] @{user} pushed {len(commits)} commits to {branch}: {url}", + f"[{repository}] @{user} pushed {len(commits)} commits to {branch} ([{commit_ids}]({url}))", repository=repository, ) for commit in commits[-3:]: