From ab5e664a5a7b34579df753f28391cd86cce4cea0 Mon Sep 17 00:00:00 2001 From: Poruri Sai Rahul Date: Tue, 13 Jul 2021 21:59:56 +0530 Subject: [PATCH] DEV : Setup slack notification for cron job modified: .github/workflows/ets-from-source.yml --- .github/workflows/ets-from-source.yml | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/ets-from-source.yml b/.github/workflows/ets-from-source.yml index a7b44091..dc55f31c 100644 --- a/.github/workflows/ets-from-source.yml +++ b/.github/workflows/ets-from-source.yml @@ -42,3 +42,31 @@ jobs: uses: GabrielBB/xvfb-action@v1 with: run: edm run -- python etstool.py test + + notify-on-failure: + needs: test-with-edm + if: failure() + runs-on: ubuntu-latest + steps: + - name: Notify Slack channel on failure + uses: voxmedia/github-action-slack-notify-build@v1 + with: + channel_id: ${{ secrets.ETS_BOTS_SLACK_CHANNEL_ID }} + status: FAILED + color: danger + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_ACTION_SECRET }} + + notify-on-success: + needs: test-with-edm + if: success() + runs-on: ubuntu-latest + steps: + - name: Notify Slack channel on success + uses: voxmedia/github-action-slack-notify-build@v1 + with: + channel_id: ${{ secrets.ETS_BOTS_SLACK_CHANNEL_ID }} + status: SUCCESS + color: good + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_ACTION_SECRET }}