Skip to content

Commit

Permalink
Revert "use commit as text, and leave the attachmen for color"
Browse files Browse the repository at this point in the history
This reverts commit 60e9e1d.
  • Loading branch information
franklychilled committed Feb 29, 2024
1 parent 60e9e1d commit c735727
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/slackNotification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ export const getSlackMessageAttachments = (results: JunitResult): unknown => {
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": getCommitText(results)
},
"accessory": {
"type": "button",
"text": {
Expand All @@ -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<unknown> => {
Expand Down

0 comments on commit c735727

Please sign in to comment.