From e469de582bedc5b5394bbbe81095d0508e2bdd79 Mon Sep 17 00:00:00 2001 From: Coen van der Wel Date: Thu, 28 Apr 2022 13:30:55 +0200 Subject: [PATCH] Merge branch 'main' into v1 # Conflicts: # dist/index.js # dist/index.js.map # src/main.ts --- src/main.ts | 65 ++++++++--------------------------------------------- 1 file changed, 9 insertions(+), 56 deletions(-) diff --git a/src/main.ts b/src/main.ts index e80b0e4..ad78e1f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -241,7 +241,7 @@ class TestReporter { core.setOutput('url_html', resp.data.html_url) core.info(`Check run details: ${resp.data.details_url}`) - if (isFailed && this.slackWebhook && this.context.branch === 'master') { + if (this.slackWebhook && this.context.branch === 'master') { const webhook = new IncomingWebhook(this.slackWebhook) const passed = results.reduce((sum, tr) => sum + tr.passed, 0) const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0) @@ -250,40 +250,11 @@ class TestReporter { const req = { blocks: [ { - type: 'header', + type: 'section', text: { - type: 'plain_text', - text: 'Test results' + type: 'mrkdwn', + text: `<${resp.data.html_url}|Result>: :large_green_circle: ${passed} :large_orange_circle: ${skipped} :red_circle: ${failed}` } - }, - { - type: 'section', - fields: [ - { - type: 'mrkdwn', - text: `*Total:*\n${passed + skipped + failed}` - }, - { - type: 'mrkdwn', - text: `*Passed:*\n:large_green_circle: ${passed}` - } - ] - }, - { - type: 'section', - fields: [ - { - type: 'mrkdwn', - text: `*Skipped:*\n:large_orange_circle: ${skipped}` - }, - { - type: 'mrkdwn', - text: `*Failed:*\n:red_circle: ${failed}` - } - ] - }, - { - type: 'divider' } ] } @@ -294,32 +265,14 @@ class TestReporter { req.blocks.push({ type: 'section', - fields: [ - { - type: 'mrkdwn', - text: `<${resp.data.html_url}#r${runIndex}|*${runName}*>` - }, - { - type: 'mrkdwn', - text: `:red_circle: ${tr.failed}` - } - ] + text: + { + type: 'mrkdwn', + text: `:red_circle: ${tr.failed} in <${resp.data.html_url}#r${runIndex}|*${runName}*>` + } }) }) - req.blocks.push( - { - type: 'divider' - }, - { - type: 'section', - text: { - type: 'mrkdwn', - text: `<${resp.data.html_url}|View full report>` - } - } - ) - await webhook.send(req) }