diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3462d036..48f9c3f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,7 +59,53 @@ jobs: with: slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFY_PUBLIC_SHARED_ACTIONS }} status: success - success-message: ":white_check_mark: ${{ github.workflow }} workflow successfully ran within ${{ github.repository }}" + payload: | + { + "text": "Completely custom Slack message for CI", + "blocks": [ + { + "type": "header", + "text": { + "type": "plain_text", + "emoji": true, + "text": "CI Workflow Success" + } + }, + { + "type": "section", + "fields": [ + { + "type": "mrkdwn", + "text": "*Repository:*\n<${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>" + }, + { + "type": "mrkdwn", + "text": "*Branch:*\n<${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}|${{ github.ref_name }}>" + }, + { + "type": "mrkdwn", + "text": "*Workflow Run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_number }}>" + }, + { + "type": "mrkdwn", + "text": "*TriggeredByCommit:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ steps.slack-variables.outputs.short-commit-hash }}>" + }, + { + "type": "mrkdwn", + "text": "*Triggered By:*\n${{ github.actor }}" + }, + { + "type": "mrkdwn", + "text": "*Commit Author:*\n${{ github.event.head_commit.author.name }}" + }, + { + "type": "mrkdwn", + "text": "*Event Name:*\n${{ github.event_name }}" + } + ] + } + ] + } # Failure Notification - name: Send Failure Slack alert @@ -68,4 +114,50 @@ jobs: with: slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_ALERT_PUBLIC_SHARED_ACTIONS }} status: failure - failure-message: ":x: This is a *failure* notification from ${{ github.repository }} for workflow ${{ github.workflow }}" \ No newline at end of file + payload: | + { + "text": "Completely custom Slack message for CI", + "blocks": [ + { + "type": "header", + "text": { + "type": "plain_text", + "emoji": true, + "text": "CI Workflow Failure" + } + }, + { + "type": "section", + "fields": [ + { + "type": "mrkdwn", + "text": "*Repository:*\n<${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>" + }, + { + "type": "mrkdwn", + "text": "*Branch:*\n<${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}|${{ github.ref_name }}>" + }, + { + "type": "mrkdwn", + "text": "*Workflow Run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_number }}>" + }, + { + "type": "mrkdwn", + "text": "*TriggeredByCommit:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ steps.slack-variables.outputs.short-commit-hash }}>" + }, + { + "type": "mrkdwn", + "text": "*Triggered By:*\n${{ github.actor }}" + }, + { + "type": "mrkdwn", + "text": "*Commit Author:*\n${{ github.event.head_commit.author.name }}" + }, + { + "type": "mrkdwn", + "text": "*Event Name:*\n${{ github.event_name }}" + } + ] + } + ] + } \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a369bdd4..b6506e4e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,7 +78,49 @@ jobs: with: slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFY_PUBLIC_SHARED_ACTIONS }} status: success - success-message: ":white_check_mark: ${{ github.workflow }} workflow successfully ran within ${{ github.repository }}" + payload: | + { + "text": "Completely custom Slack message for release", + "blocks": [ + { + "type": "header", + "text": { + "type": "plain_text", + "emoji": true, + "text": "Release Workflow Success" + } + }, + { + "type": "section", + "fields": [ + { + "type": "mrkdwn", + "text": "*Repository:*\n<${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>" + }, + { + "type": "mrkdwn", + "text": "*Branch:*\n<${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}|${{ github.ref_name }}>" + }, + { + "type": "mrkdwn", + "text": "*Workflow Run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_number }}>" + }, + { + "type": "mrkdwn", + "text": "*TriggeredByCommit:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>" + }, + { + "type": "mrkdwn", + "text": "*Triggered By:*\n${{ github.actor }}" + }, + { + "type": "mrkdwn", + "text": "*Event Name:*\n${{ github.event_name }}" + } + ] + } + ] + } # Failure Notification - name: Send Failure Notification @@ -87,4 +129,46 @@ jobs: with: slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_ALERT_PUBLIC_SHARED_ACTIONS }} status: failure - failure-message: ":x: This is a *failure* notification from ${{ github.repository }} for workflow ${{ github.workflow }}" + payload: | + { + "text": "Completely custom Slack message for release", + "blocks": [ + { + "type": "header", + "text": { + "type": "plain_text", + "emoji": true, + "text": "Release Workflow Failure" + } + }, + { + "type": "section", + "fields": [ + { + "type": "mrkdwn", + "text": "*Repository:*\n<${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>" + }, + { + "type": "mrkdwn", + "text": "*Branch:*\n<${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}|${{ github.ref_name }}>" + }, + { + "type": "mrkdwn", + "text": "*Workflow Run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_number }}>" + }, + { + "type": "mrkdwn", + "text": "*TriggeredByCommit:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>" + }, + { + "type": "mrkdwn", + "text": "*Triggered By:*\n${{ github.actor }}" + }, + { + "type": "mrkdwn", + "text": "*Event Name:*\n${{ github.event_name }}" + } + ] + } + ] + } \ No newline at end of file