Skip to content

Commit 86b0ca4

Browse files
authored
Merge pull request #321 from cipherstash/post-to-slack-on-build-fail
🚀 ci: add Slack notifications for build failures on main
2 parents 51e1d07 + 706dddb commit 86b0ca4

File tree

3 files changed

+37
-5
lines changed

3 files changed

+37
-5
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Send Slack Notification
2+
3+
inputs:
4+
channel:
5+
description: 'Destination Slack channel'
6+
required: true
7+
8+
webhook_url:
9+
description: 'Slack notification webhook url'
10+
required: true
11+
12+
runs:
13+
using: composite
14+
steps:
15+
- name: "Notify slack on failure"
16+
if: failure() && github.ref == 'refs/heads/main'
17+
uses: slackapi/slack-github-action@v1
18+
with:
19+
payload: |
20+
{
21+
"text": ":alert::alert::alert:\n\nBuild failed on `proxy/main`!\n\n<https://github.com/cipherstash/cipherstash-suite/actions/runs/${{ github.run_id }}|View run>",
22+
"channel": "#${{ inputs.channel }}"
23+
}
24+
env:
25+
SLACK_WEBHOOK_URL: ${{ inputs.webhook_url }}
26+

.github/workflows/benchmark.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,9 @@ jobs:
5757
summary-always: true
5858
auto-push: true
5959
benchmark-data-dir-path: docs
60+
61+
- uses: ./.github/actions/send-slack-notification
62+
with:
63+
channel: engineering
64+
webhook_url: ${{ secrets.SLACK_NOTIFICATION_WEBHOOK_URL }}
65+

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ jobs:
3838
run: |
3939
mise run --output prefix test
4040
41-
# Always show the Proxy logs, for debugging
42-
- name: Show Proxy logs
43-
if: always()
44-
run: |
45-
docker logs --timestamps proxy-tls
41+
- uses: ./.github/actions/send-slack-notification
42+
with:
43+
channel: engineering
44+
webhook_url: ${{ secrets.SLACK_NOTIFICATION_WEBHOOK_URL }}
45+

0 commit comments

Comments
 (0)