Fix package + add trivyignore

This commit is contained in:
2024-04-22 16:45:05 +02:00
parent 504a9db8f0
commit 8f1719a17f
3 changed files with 50 additions and 42 deletions

View File

@@ -1,42 +0,0 @@
from os import environ
from discord_webhook import DiscordEmbed, DiscordWebhook
webhook = DiscordWebhook(environ["PLUGIN_WEBHOOK_URL"])
success = environ["CI_PIPELINE_STATUS"] != "failed"
webhook.username = "Woodpecker CI"
webhook.avatar_url = "https://ci.shielddagger.com/favicons/favicon-dark-success.png" if success else \
"https://ci.shielddagger.com/favicons/favicon-dark-error.png"
webhook.add_embed(DiscordEmbed(
"Pipeline Failed" if not success else "Pipeline Succeeded",
color="ED4245" if environ["CI_PIPELINE_STATUS"] == "failed" else "57F287",
url=environ["CI_PIPELINE_URL"],
author={
"name": environ["CI_COMMIT_AUTHOR"],
"icon_url": environ["CI_COMMIT_AUTHOR_AVATAR"]
},
footer={
"text": environ["CI_REPO"],
"icon_url": environ["CI_REPO_URL"]
},
provider={
"name": "Woodpecker CI",
"url": environ["PLUGIN_WOODPECKER_URL"]
},
fields=[{
"name": "Commit",
"value": environ["CI_COMMIT_SHA"][0:8],
"inline": True
},{
"name": "Branch",
"value": environ["CI_COMMIT_BRANCH"],
"inline": True
},{
"name": "Commit Message",
"value": environ["CI_COMMIT_MESSAGE"]
}]
))
webhook.execute()

View File

@@ -0,0 +1,42 @@
from os import environ
from discord_webhook import DiscordEmbed, DiscordWebhook
webhook = DiscordWebhook(environ["PLUGIN_WEBHOOK_URL"])
success = environ["CI_PIPELINE_STATUS"] != "failed"
webhook.username = "Woodpecker CI"
webhook.avatar_url = "https://ci.shielddagger.com/favicons/favicon-dark-success.png" if success else \
"https://ci.shielddagger.com/favicons/favicon-dark-error.png"
webhook.add_embed(DiscordEmbed(
"Pipeline Failed" if not success else "Pipeline Succeeded",
color="ED4245" if environ["CI_PIPELINE_STATUS"] == "failed" else "57F287",
url=environ["CI_PIPELINE_URL"],
author={
"name": environ["CI_COMMIT_AUTHOR"],
"icon_url": environ["CI_COMMIT_AUTHOR_AVATAR"]
},
footer={
"text": environ["CI_REPO"],
"icon_url": environ["CI_REPO_URL"]
},
provider={
"name": "Woodpecker CI",
"url": environ["PLUGIN_WOODPECKER_URL"]
},
fields=[{
"name": "Commit",
"value": environ["CI_COMMIT_SHA"][0:8],
"inline": True
},{
"name": "Branch",
"value": environ["CI_COMMIT_BRANCH"],
"inline": True
},{
"name": "Commit Message",
"value": environ["CI_COMMIT_MESSAGE"]
}]
))
webhook.execute()