Skip to content

Commit 7e55eea

Browse files
authored
Add slack notifications on failed build
Refs: OP-186
1 parent e8b61d7 commit 7e55eea

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/build.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,15 @@ jobs:
150150

151151
- name: Run Behat
152152
run: vendor/bin/behat --colors --strict -vvv --no-interaction || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun
153-
153+
154+
- name: Failed build Slack notification
155+
uses: rtCamp/action-slack-notify@v2
156+
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
157+
env:
158+
SLACK_CHANNEL: ${{ secrets.FAILED_BUILD_SLACK_CHANNEL }}
159+
SLACK_COLOR: ${{ job.status }}
160+
SLACK_ICON: https://github.com/rtCamp.png?size=48
161+
SLACK_MESSAGE: ':x:'
162+
SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository
163+
SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }}
164+
SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}

0 commit comments

Comments
 (0)