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 => {