From b85e9dbcb83c2dc96f7e3b0f03ddf1c5ee3e9f3f Mon Sep 17 00:00:00 2001 From: liszkapawel <88146754+liszkapawel@users.noreply.github.com> Date: Mon, 31 Jul 2023 12:23:02 +0200 Subject: [PATCH] Add slack notifications on failed build Refs: OP-186 --- .github/workflows/coding-standard.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/coding-standard.yml b/.github/workflows/coding-standard.yml index d030add..2c2f078 100644 --- a/.github/workflows/coding-standard.yml +++ b/.github/workflows/coding-standard.yml @@ -91,3 +91,16 @@ jobs: - name: Run PHPStan in /test directory run: ./vendor/bin/phpstan analyze --configuration=./phpstan.neon tests --level=5 + + - + name: Failed build Slack notification + uses: rtCamp/action-slack-notify@v2 + if: ${{ failure() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') }} + env: + SLACK_CHANNEL: ${{ secrets.FAILED_BUILD_SLACK_CHANNEL }} + SLACK_COLOR: ${{ job.status }} + SLACK_ICON: https://github.com/rtCamp.png?size=48 + SLACK_MESSAGE: ':x:' + SLACK_TITLE: Failed build on ${{ github.event.repository.name }} repository + SLACK_USERNAME: ${{ secrets.FAILED_BUILD_SLACK_USERNAME }} + SLACK_WEBHOOK: ${{ secrets.FAILED_BUILD_SLACK_WEBHOOK }}