From ff22c29abaa665653f22803d6d1226c9bc144e72 Mon Sep 17 00:00:00 2001 From: phil-l-brockwell Date: Wed, 27 Nov 2024 16:22:02 +0000 Subject: [PATCH] Simplfy slack notifications --- .github/workflows/slack_notification.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/slack_notification.yml b/.github/workflows/slack_notification.yml index 56fa9d6d5..74726a1ac 100644 --- a/.github/workflows/slack_notification.yml +++ b/.github/workflows/slack_notification.yml @@ -1,4 +1,4 @@ -name: Check for tests or deployment results +name: Check for workflow results on: workflow_run: workflows: ["CI","Dev deployment","Staging deployment","Production deployment"] @@ -28,22 +28,11 @@ jobs: done echo "::set-output name=suid::$suid" - - name: tests + - name: workflow-complete uses: ravsamhq/notify-slack-action@v2 - if: ${{ github.event.workflow_run.head_branch != 'main' && github.event.workflow_run.head_branch != 'staging' && github.event.workflow_run.head_branch != 'production' }} with: status: ${{ github.event.workflow_run.conclusion }} - notification_title: "Tests ${{github.event.workflow_run.conclusion}} on *${{github.event.workflow_run.head_branch}}* - <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View ${{github.event.workflow_run.conclusion}}>" - message_format: "{emoji} *${{github.event.workflow_run.name}}* ${{github.event.workflow_run.conclusion}} in <{repo_url}|{repo}>" - footer: "Linked Repo <${{github.server_url}}/${{github.repository}}|${{github.repository}}> | <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View ${{github.event.workflow_run.conclusion}}>" - mention_users: ${{ steps.extract_slack_id.outputs.suid }} - mention_users_when: "failure,warnings" - - name: deployment - uses: ravsamhq/notify-slack-action@v2 - if: ${{ github.event.workflow_run.head_branch == 'main' || github.event.workflow_run.head_branch == 'staging' || github.event.workflow_run.head_branch == 'production' }} - with: - status: ${{ github.event.workflow_run.conclusion }} - notification_title: "Deployment ${{github.event.workflow_run.conclusion}} on *${{github.event.workflow_run.head_branch}}* - <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View ${{github.event.workflow_run.conclusion}}>" + notification_title: "Workflow ${{github.event.workflow_run.conclusion}} on *${{github.event.workflow_run.head_branch}}* - <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View ${{github.event.workflow_run.conclusion}}>" message_format: "{emoji} *${{github.event.workflow_run.name}}* ${{github.event.workflow_run.conclusion}} in <{repo_url}|{repo}>" footer: "Linked Repo <${{github.server_url}}/${{github.repository}}|${{github.repository}}> | <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View ${{github.event.workflow_run.conclusion}}>" mention_users: ${{ steps.extract_slack_id.outputs.suid }}