From c735727225120d4c85ea9b29cce13e43d28ea5fd Mon Sep 17 00:00:00 2001 From: Franck Terray Date: Thu, 29 Feb 2024 10:35:49 +0000 Subject: [PATCH] Revert "use commit as text, and leave the attachmen for color" This reverts commit 60e9e1d90f339a2ed7fe76fd99c7a3aeb81692fd. --- src/slackNotification.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/slackNotification.ts b/src/slackNotification.ts index 8bdf835..9d48015 100644 --- a/src/slackNotification.ts +++ b/src/slackNotification.ts @@ -81,6 +81,10 @@ export const getSlackMessageAttachments = (results: JunitResult): unknown => { "blocks": [ { "type": "section", + "text": { + "type": "mrkdwn", + "text": getCommitText(results) + }, "accessory": { "type": "button", "text": { @@ -98,7 +102,19 @@ export const getSlackMessageAttachments = (results: JunitResult): unknown => { }; export const getSlackTextMessage = (results: JunitResult): string => { - return getCommitText(results); + const details = results.suite.map((result) => { + return getTextSummaryLine(result); + }); + + const extra = results.extra_message?.length > 0 ? [ + results.extra_message + ] : []; + + return [ + getCommitText(results), + ...details, + ...extra + ].join("\n"); }; export const sendResultToSlack = async (slackToken: string | undefined, channel: string, junitResult: JunitResult): Promise => {