Skip to content

Commit 8cc0272

Browse files
authored
Merge pull request #482 from BitBagCommerce/feature/slack-notifications
Add slack notifications on failed builds
2 parents 97080e1 + 8356a48 commit 8cc0272

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,16 @@ jobs:
180180
name: Behat logs
181181
path: etc/build/
182182
if-no-files-found: ignore
183+
184+
-
185+
name: Failed build Slack notification
186+
uses: rtCamp/action-slack-notify@v2
187+
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
188+
env:
189+
SLACK_CHANNEL: ${{ secrets.FAILED_BUILD_SLACK_CHANNEL }}
190+
SLACK_COLOR: ${{ job.status }}
191+
SLACK_ICON: https://github.com/rtCamp.png?size=48
192+
SLACK_MESSAGE: ':x:'
193+
SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository
194+
SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }}
195+
SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}

.github/workflows/coding_standard.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,15 @@ jobs:
8181

8282
- name: Run ECS
8383
run: vendor/bin/ecs
84+
85+
- name: Failed build Slack notification
86+
uses: rtCamp/action-slack-notify@v2
87+
if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }}
88+
env:
89+
SLACK_CHANNEL: ${{ secrets.FAILED_BUILD_SLACK_CHANNEL }}
90+
SLACK_COLOR: ${{ job.status }}
91+
SLACK_ICON: https://github.com/rtCamp.png?size=48
92+
SLACK_MESSAGE: ':x:'
93+
SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository
94+
SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }}
95+
SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}

0 commit comments

Comments
 (0)