diff --git a/app.py b/app.py index e46e247..111c859 100644 --- a/app.py +++ b/app.py @@ -24,7 +24,13 @@ def main(): commits = data["commits"] commit_count = f"{len(commits)} commit{'s' if len(commits) > 1 else ''}" message = "[inlinecode]" + commits[0]["message"].split('\n',1)[0] + "[/inlinecode]" - others = f" (et {len(commits)-1} autres commits)" if len(commits) > 1 else "" + + if len(commits) <= 1: + others = "" + elif len(commits) == 2: + others = " (et 1 autre commit)" + else: + others = f" (et {len(commits)-1} autres commits)" url_user = make_url_user(data['pusher']) url_commits = f"[url={data['compare_url']}]{commit_count}[/url]" @@ -48,7 +54,7 @@ def main(): if data['action'] == "closed": msg = f"{url_user} a fermé le ticket {url_issue} dans {url_repository}" - elif data['action'] == "created": + elif data['action'] in ["created", "opened"]: msg = f"{url_user} a créé un ticket {url_issue} dans {url_repository}" else: msg = f"{url_user} a <{data['action']}> le ticket {url_issue} dans {url_repository}"