Skip to content

Commit fe52e20

Browse files
Add Slack notification for failed builds (#46)
1 parent ad5dacd commit fe52e20

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
branches:
99
- master
1010
schedule:
11-
- cron: '* 5 * * *'
11+
- cron: '0 5 * * *'
1212

1313
env:
1414
DOCKER_BUILDKIT: 1
@@ -48,3 +48,20 @@ jobs:
4848
run: make test
4949
env:
5050
NGINX_PLUS_VERSION: nightly
51+
52+
job-failure:
53+
name: Report Failures
54+
runs-on: ubuntu-18.04
55+
if: failure()
56+
steps:
57+
- name: Slack Notification
58+
uses: rtCamp/action-slack-notify@master
59+
env:
60+
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
61+
SLACK_COLOR: '#3278BD'
62+
SLACK_ICON_EMOJI: ':github:'
63+
SLACK_TITLE: Pipeline Failure
64+
SLACK_MESSAGE: 'The pipeline has failed, please check the logs.'
65+
SLACK_FOOTER: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
66+
SLACK_USERNAME: GitHub-Actions
67+
SLACK_WEBHOOK: ${{ secrets.SLACK_HOOK }}

0 commit comments

Comments
 (0)