Skip to content

Commit

Permalink
add workflow to notify failure
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioettorre committed Jan 22, 2024
1 parent e9f623a commit 5e0c7ab
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/failure_workflow.yaml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 5e0c7ab

Please sign in to comment.