mirror of
https://github.com/bsedin/matrix-webhook.git
synced 2026-04-09 11:25:40 +00:00
Merge branch 'master' into reconnect
This commit is contained in:
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- replace black & isort by ruff
|
- replace black & isort by ruff
|
||||||
- update dependencies
|
- update dependencies
|
||||||
- try to reconnect on LocalProtocolError
|
- try to reconnect on LocalProtocolError
|
||||||
|
- add mwe gitlab webhook formatter. Intergrations are better for now
|
||||||
|
|
||||||
## [v3.8.0] - 2023-04-08
|
## [v3.8.0] - 2023-04-08
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,26 @@ def gitlab_teams(data, headers):
|
|||||||
return data
|
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):
|
def grn(data, headers):
|
||||||
"""Pretty-print a github release notifier (grn) notification."""
|
"""Pretty-print a github release notifier (grn) notification."""
|
||||||
version, title, author, package = (
|
version, title, author, package = (
|
||||||
|
|||||||
Reference in New Issue
Block a user