Skip to content

Commit 13c67e5

Browse files
committed
ci: add failure slack notifications to preflight workflow
1 parent 9c0a0ae commit 13c67e5

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/preflight.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,39 @@ jobs:
9696
--architecture "linux/${ARCH_FOR_PREFLIGHT}" \
9797
--executable ./preflight-linux-amd64 \
9898
--token "${{ secrets.RH_PYXIS_API_TOKEN }}" \
99+
100+
notify:
101+
name: Failure Notification
102+
needs: [preflight]
103+
runs-on: ubuntu-latest
104+
if: failure()
105+
steps:
106+
- uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
107+
with:
108+
channel-id: "C07UG6JH44F" # notifications-container-images
109+
payload: |
110+
{
111+
"text": "*${{ github.workflow }}* failed",
112+
"attachments": [
113+
{
114+
"pretext": "See the details below for a summary of which job(s) failed.",
115+
"color": "#aa0000",
116+
"fields": [
117+
{
118+
"title": "Preflight",
119+
"short": true,
120+
"value": "${{ needs.preflight.result }}"
121+
}
122+
],
123+
"actions": [
124+
{
125+
"type": "button",
126+
"text": "Go to workflow run",
127+
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
128+
}
129+
]
130+
}
131+
]
132+
}
133+
env:
134+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}

0 commit comments

Comments
 (0)