diff --git a/wmn.py b/wmn.py index fdb467f..0518792 100644 --- a/wmn.py +++ b/wmn.py @@ -87,13 +87,15 @@ def process_gitlab_request(): return sorted(commits, key=lambda commit: commit["timestamp"]) def extract_commit_message(commit): - return shorten(next(iter_first_line(commit["message"]), "$EMPTY_COMMIT_MESSAGE - impossibruh")) + msg = shorten(next(iter_first_line(commit["message"]), "$EMPTY_COMMIT_MESSAGE - impossibruh")) + url = commit["url"] + return msg, url username = request.json["user_name"] commit_messages = list(map(extract_commit_message, sort_commits_by_time(request.json["commits"]))) project_name = request.json["project"]["name"] - html_commits = "\n".join((f"
  • {msg}
  • " for msg in commit_messages)) - text_commits = "\n".join((f"- {msg}" for msg in commit_messages)) + html_commits = "\n".join((f'
  • {msg}
  • ' for (msg, url) in commit_messages)) + text_commits = "\n".join((f"- [{msg}]({url})" for (msg, url) in commit_messages)) try: room.send_html(f"{username} pushed {len(commit_messages)} commits to {project_name}
    \n" f"\n",