Skip to content

Commit

Permalink
Add slack notification for validate checks run
Browse files Browse the repository at this point in the history
Signed-off-by: thepetk <[email protected]>
  • Loading branch information
thepetk committed Jan 15, 2024
1 parent 551f9e0 commit 44aaf37
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/validate-stacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,43 @@ jobs:

- name: Check the devfile stacks with odo v3
run: bash tests/check_odov3.sh

slack_notification:
name: with odo v3
runs-on: ubuntu-latest
needs: [validate-devfile-schema, non-terminating, odov2, odov3]
steps:
- name: Send slack notification
if: ${{ always() && contains(needs.*.result, 'failure') }}
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
payload: |
{
"text": "GitHub Action failed",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Status:* :red_circle: failure\n*Severity:* medium\n*Title:* Registry's validate stacks nightly run\n*Description:* run failed for HEAD_REF ${{ github.head_ref }}"
}
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": ":github: Failed action"
},
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFICATIONS_TOKEN }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

0 comments on commit 44aaf37

Please sign in to comment.