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
16
server.py
16
server.py
|
@ -478,9 +478,19 @@ async def github(request):
|
|||
branches = ", ".join((x["name"] for x in request.json["branches"]))
|
||||
|
||||
if state not in ("success", "pending"):
|
||||
await notify(
|
||||
f'[{repository}] {description} {target_url} on commit {url} "{commit_message}" by @{commit_author} on branch{"es" if len(branches) > 1 else ""} {branches}'
|
||||
)
|
||||
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(
|
||||
f'[{repository}] {description} {target_url} on commit {url} "{commit_message}" by @{commit_author} on branch{"es" if len(branches) > 1 else ""} {branches}'
|
||||
)
|
||||
else:
|
||||
print(
|
||||
f"Status weird stuff: [{repository}] @{user} state: {state}, description: {description}, target_url: {target_url} - {url}"
|
||||
|
|
Loading…
Reference in a new issue