Merge branch 'master' into reconnect

This commit is contained in:
Guilhem Saurel 2024-03-07 17:32:50 +01:00 committed by GitHub
commit 3389f87cb9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 0 deletions

View File

@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- replace black & isort by ruff
- update dependencies
- try to reconnect on LocalProtocolError
- add mwe gitlab webhook formatter. Intergrations are better for now
## [v3.8.0] - 2023-04-08

View File

@ -78,6 +78,26 @@ def gitlab_teams(data, headers):
return data
def gitlab_webhook(data, headers):
"""Pretty-print a gitlab notification.
NB: This is a work-in-progress minimal example for now
"""
body = []
event_name = data["event_name"]
user_name = data["user_name"]
project = data["project"]
body.append(f"New {event_name} event")
body.append(f"on [{project['name']}]({project['web_url']})")
body.append(f"by {user_name}.")
data["body"] = " ".join(body)
data["key"] = headers["X-Gitlab-Token"]
return data
def grn(data, headers):
"""Pretty-print a github release notifier (grn) notification."""
version, title, author, package = (