Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add slack notification step for nightly run failures #43

Merged
merged 11 commits into from
Jan 18, 2024
40 changes: 37 additions & 3 deletions .github/workflows/check_registry.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on:
schedule:
- cron: "0 3 * * *"
- cron: "0 3 * * *"

name: Product & Community Registries Check

Expand All @@ -14,7 +14,7 @@
jobs:
check-registry:
name: Check registry entries
runs-on: 'ubuntu-latest'
runs-on: "ubuntu-latest"
outputs:
matrix: ${{ steps.get-stacks.outputs.matrix }}
steps:
Expand All @@ -27,9 +27,43 @@
id: setup-go
uses: actions/setup-go@v4
with:
go-version: '1.19.5'
go-version: "1.19.5"
- name: Run registries check
id: build
run: |
make build
make check_registry
- name: Send slack notification
if: ${{ failure() }}
uses: slackapi/slack-github-action@v1.24.0
Fixed Show fixed Hide fixed
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:* Alizer's product & community registries 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