From 4dbce8ea69794c51c498f08d42fe7f9a63adab5b Mon Sep 17 00:00:00 2001 From: luigieai Date: Sat, 1 Oct 2022 23:40:54 -0300 Subject: [PATCH 1/2] CI: slack notification if CI SUCCESS after FAILURE --- .github/workflows/ci_cron.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index 59b5fd6cf7..2d2fd2d4cb 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -373,3 +373,23 @@ jobs: channel: ruby-agent-notifications status: FAILED color: danger + + notify_slack_success: + name: Notify slack success + needs: [unit_tests, multiverse, infinite_tracing, jruby_multiverse] + runs-on: ubuntu-22.04 + if: always() + steps: + - uses: technote-space/workflow-conclusion-action@v3 + - uses: Mercymeilya/last-workflow-status@v0.3.2 + id: last_status + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + - uses: voxmedia/github-action-slack-notify-build@v1 + if: env.WORKFLOW_CONCLUSION == 'success' + env: + SLACK_BOT_TOKEN: ${{ secrets.RUBY_GITHUB_ACTIONS_BOT_WEBHOOK }} + with: + channel: ruby-agent-notifications + status: SUCCESS + color: good \ No newline at end of file From b394025d85fc0393bf906db8a80e2d7fc1c35f0f Mon Sep 17 00:00:00 2001 From: luigieai Date: Tue, 4 Oct 2022 00:56:52 -0300 Subject: [PATCH 2/2] Added missing last_status check --- .github/workflows/ci_cron.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index 2d2fd2d4cb..f5b032300f 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -386,10 +386,10 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} - uses: voxmedia/github-action-slack-notify-build@v1 - if: env.WORKFLOW_CONCLUSION == 'success' + if: ${{ env.WORKFLOW_CONCLUSION == 'success' && steps.last_status.outputs.last_status == 'failure' }} env: SLACK_BOT_TOKEN: ${{ secrets.RUBY_GITHUB_ACTIONS_BOT_WEBHOOK }} with: channel: ruby-agent-notifications status: SUCCESS - color: good \ No newline at end of file + color: good