Skip to content

Commit 7995f1e

Browse files
authored
ci(ubi-rust-builder): Send notifications on rerun of failed workflows (#1438)
* ci(ubi-rust-builder): Send notifications on rerun of failed workflows * chore(ubi-rust-builder): Fail on purpose to test notification * Revert "chore(ubi-rust-builder): Fail on purpose to test notification" This reverts commit a3f279f.
1 parent 1cfaa66 commit 7995f1e

1 file changed

Lines changed: 11 additions & 37 deletions

File tree

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

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ jobs:
6666
# Uses the keyless signing flow with Github Actions as identity provider
6767
cosign sign -y "oci.stackable.tech/sdp/${{ matrix.ubi-version }}-rust-builder@$DIGEST"
6868
69-
create_manifest:
70-
name: Create and Push Image Index Manifest
69+
publish_manifests:
70+
name: Build/Publish Image Index Manifest
7171
needs: ["build"]
7272
permissions:
7373
id-token: write
@@ -108,41 +108,15 @@ jobs:
108108
109109
notify:
110110
name: Failure Notification
111-
needs: [build, create_manifest]
111+
needs: [build, publish_manifests]
112112
runs-on: ubuntu-latest
113-
if: failure()
113+
if: failure() || (github.run_attempt > 1 && !cancelled())
114114
steps:
115-
- uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
115+
- name: Send Notification
116+
uses: stackabletech/actions/send-slack-notification@c34dbb4f27b274736c7d2edc6f6f30a03d03edf5 # v0.12.2
116117
with:
117-
channel-id: "C07UG6JH44F" # notifications-container-images
118-
payload: |
119-
{
120-
"text": "*${{ github.workflow }}* failed (attempt ${{ github.run_attempt }})",
121-
"attachments": [
122-
{
123-
"pretext": "See the details below for a summary of which job(s) failed.",
124-
"color": "#aa0000",
125-
"fields": [
126-
{
127-
"title": "Build",
128-
"short": true,
129-
"value": "${{ needs.build.result }}"
130-
},
131-
{
132-
"title": "Create Manifest",
133-
"short": true,
134-
"value": "${{ needs.create_manifest.result }}"
135-
}
136-
],
137-
"actions": [
138-
{
139-
"type": "button",
140-
"text": "Go to workflow run",
141-
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}"
142-
}
143-
]
144-
}
145-
]
146-
}
147-
env:
148-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
118+
publish-manifests-result: ${{ needs.publish_manifests.result }}
119+
build-result: ${{ needs.build.result }}
120+
slack-token: ${{ secrets.SLACK_CONTAINER_IMAGE_TOKEN }}
121+
channel-id: C07UG6JH44F # notifications-container-images
122+
type: container-image-build

0 commit comments

Comments
 (0)