Fix package + add trivyignore
This commit is contained in:
parent
504a9db8f0
commit
8f1719a17f
8
.trivyignore
Normal file
8
.trivyignore
Normal file
@ -0,0 +1,8 @@
|
||||
CVE-2023-52425
|
||||
CVE-2024-26462
|
||||
CVE-2023-7104
|
||||
CVE-2023-50387
|
||||
CVE-2023-50868
|
||||
CVE-2023-31484
|
||||
CVE-2023-45853
|
||||
CVE-2024-2961
|
@ -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()
|
42
src/discord_notifier/__main__.py
Normal file
42
src/discord_notifier/__main__.py
Normal 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()
|
Loading…
x
Reference in New Issue
Block a user