From 5e0c7ab2d1f2e2cc00ba796040644264dda9e1bc Mon Sep 17 00:00:00 2001 From: antonioettorre Date: Mon, 22 Jan 2024 10:08:24 +0100 Subject: [PATCH] add workflow to notify failure --- .github/workflows/failure_workflow.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/failure_workflow.yaml diff --git a/.github/workflows/failure_workflow.yaml b/.github/workflows/failure_workflow.yaml new file mode 100644 index 00000000..a4f5b183 --- /dev/null +++ b/.github/workflows/failure_workflow.yaml @@ -0,0 +1,23 @@ +--- +name: Failure on Workflow + +on: + workflow_run: + workflows: + - "Package for Windows" + types: + - completed + +jobs: + on-failure: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'failure' }} + steps: + - uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ github.event.workflow_run.conclusion }} + notification_title: " ${{github.event.workflow_run.name}} - ${{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 Failure>" + message_format: ":fire: *${{github.event.workflow_run.name}}* ${{github.event.workflow_run.conclusion}} in <${{github.server_url}}/${{github.repository}}/${{github.event.workflow_run.head_branch}}|${{github.repository}}>" + footer: "Linked Repo <${{github.server_url}}/${{github.repository}}|${{github.repository}}> | <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>" + env: + SLACK_WEBHOOK_URL: ${{ secrets.MONITORING_SLACK }}