Open dmpinder opened 2 years ago
Have added to Demo repo and outputting to updates channel (as that is where the app is installed).
Which workflows do we want this on @dmpinder?
- name: "Failure notification."
if: ${{ failure() }}
id: 'slack'
uses: 'slackapi/slack-github-action@v1.25.0'
with:
channel-id: 'updates'
payload: |
{
"text": "${{ github.workflow }} workflow failed for ${{ github.event.repository.name }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ github.workflow }} workflow failed for ${{ github.event.repository.name }}.\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View>"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
Looks good!
Failure notifications on build and static analysis would be ideal, thanks.
Have added both to the demo repo if you want to check them out.
Picking this up again, not sure how to test this, or if I need to test it? If you're happy it's working lets roll it out on the other repos.
For future reference: https://stackoverflow.com/questions/58858429/how-to-run-a-github-actions-step-even-if-the-previous-step-fails-while-still-f#answers