mirror of
https://github.com/YunoHost/webhooks.git
synced 2024-09-03 19:56:54 +02:00
Simplify messages for gitlab CI pipeline failed/canceled
This commit is contained in:
parent
12b5331266
commit
8235ac30f4
1 changed files with 13 additions and 3 deletions
10
server.py
10
server.py
|
@ -478,6 +478,16 @@ async def github(request):
|
||||||
branches = ", ".join((x["name"] for x in request.json["branches"]))
|
branches = ", ".join((x["name"] for x in request.json["branches"]))
|
||||||
|
|
||||||
if state not in ("success", "pending"):
|
if state not in ("success", "pending"):
|
||||||
|
if description == "Pipeline failed on GitLab":
|
||||||
|
pipeline_id = target_url.split("/")[-1]
|
||||||
|
await notify(
|
||||||
|
f'[{repository}] :red_circle: Pipeline [{pipeline_id}]({target_url}) failed on branch {branches}'
|
||||||
|
)
|
||||||
|
elif description == "Pipeline canceled on GitLab":
|
||||||
|
await notify(
|
||||||
|
f'[{repository}] :heavy_multiplication_x: Pipeline [{pipeline_id}]({target_url}) canceled on branch {branches}'
|
||||||
|
)
|
||||||
|
else:
|
||||||
await notify(
|
await notify(
|
||||||
f'[{repository}] {description} {target_url} on commit {url} "{commit_message}" by @{commit_author} on branch{"es" if len(branches) > 1 else ""} {branches}'
|
f'[{repository}] {description} {target_url} on commit {url} "{commit_message}" by @{commit_author} on branch{"es" if len(branches) > 1 else ""} {branches}'
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue