Skip to content

Commit 0e4aaf9

Browse files
committed
ci: add failure slack notifications to ubi rust builder workflow
1 parent 61c4ee7 commit 0e4aaf9

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

.github/workflows/ubi-rust-builder.yml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: UBI Builder rebuild
2+
name: Build UBI Rust Builders
33

44
on:
55
push:
@@ -78,3 +78,44 @@ jobs:
7878
# This generates a signature and publishes it to the registry, next to the image
7979
# Uses the keyless signing flow with Github Actions as identity provider
8080
cosign sign -y "$MANIFEST_LIST_NAME@$DIGEST"
81+
82+
notify:
83+
name: Failure Notification
84+
needs: [build, create_manifest]
85+
runs-on: ubuntu-latest
86+
if: failure()
87+
steps:
88+
- uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
89+
with:
90+
channel-id: "C07UG6JH44F" # notifications-container-images
91+
payload: |
92+
{
93+
"text": "*${{ github.workflow }}* failed",
94+
"attachments": [
95+
{
96+
"pretext": "See the details below for a summary of which job(s) failed.",
97+
"color": "#aa0000",
98+
"fields": [
99+
{
100+
"title": "Build",
101+
"short": true,
102+
"value": "${{ needs.build.result }}"
103+
},
104+
{
105+
"title": "Create Manifest",
106+
"short": true,
107+
"value": "${{ needs.create_manifest.result }}"
108+
}
109+
],
110+
"actions": [
111+
{
112+
"type": "button",
113+
"text": "Go to workflow run",
114+
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
115+
}
116+
]
117+
}
118+
]
119+
}
120+
env:
121+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}

0 commit comments

Comments
 (0)