From 929fc79c2ed642cd6278461e12ce090a36245e1d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 11 Jun 2023 08:35:24 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- README.md | 2 +- matrix_webhook/formatters.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d1f6d93..79b19a5 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ Add a Microsoft Teams integration with an URL ending with `?formatter=gitlab_tea #### Github Release Notifier -To receiver notifications about new releases of projects hosted at github.com you can add a matrix webhook ending with `?formatter=grn&key=API_KEY` to [Github Release Notifier (grn)](https://github.com/femtopixel/github-release-notifier). +To receiver notifications about new releases of projects hosted at github.com you can add a matrix webhook ending with `?formatter=grn&key=API_KEY` to [Github Release Notifier (grn)](https://github.com/femtopixel/github-release-notifier). ## Test room diff --git a/matrix_webhook/formatters.py b/matrix_webhook/formatters.py index be3ad33..25c5cd2 100644 --- a/matrix_webhook/formatters.py +++ b/matrix_webhook/formatters.py @@ -75,8 +75,10 @@ def gitlab_teams(data, headers): def grn(data, headers): """Pretty-print a github release notifier (grn) notification.""" - version, title, author, package = ( - data[k] for k in ["version", "title", "author", "package_name"] + version, title, author, package = ( + data[k] for k in ["version", "title", "author", "package_name"] ) - data["body"] = f"### {package} - {version}\n\n{title}\n\n[{author} released new version **{version}** for **{package}**](https://github.com/{package}/releases/tag/{version}).\n\n" + data[ + "body" + ] = f"### {package} - {version}\n\n{title}\n\n[{author} released new version **{version}** for **{package}**](https://github.com/{package}/releases/tag/{version}).\n\n" return data