From d9e8862eb8a3fa187c957aab165c859c77d20d04 Mon Sep 17 00:00:00 2001 From: tomas Date: Thu, 4 Jul 2024 15:45:49 +0200 Subject: [PATCH] Chenged color attribute and added emojis to show run status on mobile. --- dist/index.js | 12 ++++++------ index.js | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dist/index.js b/dist/index.js index fb98f19..537a0e6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -231344,11 +231344,11 @@ try { const statusOpts = { success: { - status: 'Success', + status: '🟢 Success', color: 0x28A745, }, failure: { - status: 'Failure', + status: '🔴 Failure', color: 0xCB2431, }, cancelled: { @@ -231360,19 +231360,19 @@ try { const userMention = status === 'success' ? actor : `${actor}`; const formattedMessage = ` -

${statusOpts[status].status} ${workflow}

+

${statusOpts[status].status} ${workflow}

Repository ${owner}/${repo}
Commit ${payload.head_commit.id.substring(0, 7)} ${payload.head_commit.message}
-Ref ref
+Ref ${ref}
Triggered by ${userMention}
-Run #${runNumber}
+Run #${runNumber} ${md.render(message)}`; // Send message const content = { msgtype: messagetype, format: 'org.matrix.custom.html', - body: message, + body: `${statusOpts[status].status} ${workflow} @${actor}`, formatted_body: formattedMessage, }; diff --git a/index.js b/index.js index ae82bee..8652d2d 100644 --- a/index.js +++ b/index.js @@ -42,11 +42,11 @@ try { const statusOpts = { success: { - status: 'Success', + status: '🟢 Success', color: 0x28A745, }, failure: { - status: 'Failure', + status: '🔴 Failure', color: 0xCB2431, }, cancelled: { @@ -58,19 +58,19 @@ try { const userMention = status === 'success' ? actor : `${actor}`; const formattedMessage = ` -

${statusOpts[status].status} ${workflow}

+

${statusOpts[status].status} ${workflow}

Repository ${owner}/${repo}
Commit ${payload.head_commit.id.substring(0, 7)} ${payload.head_commit.message}
-Ref ref
+Ref ${ref}
Triggered by ${userMention}
-Run #${runNumber}
+Run #${runNumber} ${md.render(message)}`; // Send message const content = { msgtype: messagetype, format: 'org.matrix.custom.html', - body: message, + body: `${statusOpts[status].status} ${workflow} @${actor}`, formatted_body: formattedMessage, };