diff --git a/matrix_webhook/formatters.py b/matrix_webhook/formatters.py index 55ba43d..2d52788 100644 --- a/matrix_webhook/formatters.py +++ b/matrix_webhook/formatters.py @@ -22,8 +22,8 @@ def github(data, headers): pusher, ref, a, b, c = [ data[k] for k in ["pusher", "ref", "after", "before", "compare"] ] - pusher = f"[{pusher['name']}](https://github.com/{pusher['name']})" - data["body"] = f"@{pusher} pushed on {ref}: [{b} → {a}]({c}):\n\n" + pusher = f"[@{pusher['name']}](https://github.com/{pusher['name']})" + data["body"] = f"{pusher} pushed on {ref}: [{b} → {a}]({c}):\n\n" for commit in data["commits"]: data["body"] += f"- [{commit['message']}]({commit['url']})\n" else: diff --git a/tests/test_github.py b/tests/test_github.py index fed01d7..3943202 100644 --- a/tests/test_github.py +++ b/tests/test_github.py @@ -93,7 +93,7 @@ class GithubFormatterTest(unittest.IsolatedAsyncioTestCase): before = "ac7d1d9647008145e9d0cf65d24744d0db4862b8" after = "4bcdb25c809391baaabc264d9309059f9f48ead2" GH = "https://github.com" - expected = f'

@nim65s pushed on refs/heads/devel: ' + expected = f'

@nim65s pushed on refs/heads/devel: ' expected += f'{before} → {after}:

\n