From 0fc743d9990261c4344e5f15fa99643230761611 Mon Sep 17 00:00:00 2001 From: Chris Kalafarski Date: Mon, 23 Sep 2024 12:18:24 -0400 Subject: [PATCH] Include status reason when available --- .../stack-status-change.mjs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/status-change-slack-notifications/stack-status-change.mjs b/src/status-change-slack-notifications/stack-status-change.mjs index 8c0a687..55f8ba3 100644 --- a/src/status-change-slack-notifications/stack-status-change.mjs +++ b/src/status-change-slack-notifications/stack-status-change.mjs @@ -123,6 +123,16 @@ export default function message(event) { // Send end-stage and concerning notifications to DEBUG if (concerning.includes(status) || status.endsWith("_COMPLETE")) { msg.channel = SLACK_DEBUG_CHANNEL; + + if (statusReason) { + msg.attachments[0].blocks.push({ + type: "section", + text: { + type: "mrkdwn", + text: `> ${statusReason}`, + }, + }); + } return msg; }