Fix attachments
Attachments were still being sent by the wrong webhook Attachments now have the `ansi` extension (text coloring)
This commit is contained in:
parent
d5491731f4
commit
9b61263254
@ -68,6 +68,8 @@ webhook.add_embed(DiscordEmbed(
|
||||
try:
|
||||
if not success:
|
||||
logfile_webhook = DiscordWebhook(environ["PLUGIN_WEBHOOK_URL"], rate_limit_retry=True)
|
||||
logfile_webhook.username = "Woodpecker CI"
|
||||
logfile_webhook.avatar_url = "https://ci.shielddagger.com/favicons/favicon-dark-error.png"
|
||||
with APISession(environ["PLUGIN_WOODPECKER_URL"].rstrip("/")) as client:
|
||||
client.headers.setdefault("Authorization", f"Bearer {environ["PLUGIN_WOODPECKER_TOKEN"]}")
|
||||
|
||||
@ -86,7 +88,7 @@ try:
|
||||
logdata = b""
|
||||
for logline in loginfo:
|
||||
logdata += b64decode(logline["data"])
|
||||
webhook.add_file(logdata, f"{step['name']}.log")
|
||||
logfile_webhook.add_file(logdata, f"{step['name']}.ansi")
|
||||
except KeyError:
|
||||
webhook.add_embed(DiscordEmbed(
|
||||
"API Error",
|
||||
|
Loading…
x
Reference in New Issue
Block a user