mirror of
https://github.com/bsedin/matrix-webhook.git
synced 2026-01-16 08:05:57 +00:00
Merge branch 'master' into reconnect
This commit is contained in:
commit
3389f87cb9
@ -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
|
||||
|
||||
|
||||
@ -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 = (
|
||||
|
||||
Loading…
Reference in New Issue
Block a user