From f358b03b955e5b3cd6afbab459d24c8f4df0ce64 Mon Sep 17 00:00:00 2001 From: liszkapawel <88146754+liszkapawel@users.noreply.github.com> Date: Mon, 31 Jul 2023 13:52:23 +0200 Subject: [PATCH] Add slack notifications on failed build Refs: OP-186 --- .github/workflows/coding_standard.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/coding_standard.yml b/.github/workflows/coding_standard.yml index 588de46..b6b8c5a 100644 --- a/.github/workflows/coding_standard.yml +++ b/.github/workflows/coding_standard.yml @@ -71,5 +71,19 @@ jobs: name: Run PHPStan run: vendor/bin/phpstan analyse -c phpstan.neon -l 8 src/ - - name: Run ECS + - + name: Run ECS run: vendor/bin/ecs + + - + 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 }}