From 313e6a29e453b1e88f890f9fa73087f2d94823e8 Mon Sep 17 00:00:00 2001 From: zzak Date: Fri, 10 Mar 2023 16:00:45 +0900 Subject: [PATCH] Add action-discord notifications to main (#1903) Some examples ## Failed Multiple failed jobs Screenshot 2023-03-10 at 15 47 11 A single failed job Screenshot 2023-03-10 at 15 47 34 ## Fixed If the previous run failed, but now it passes Screenshot 2023-03-10 at 15 47 28 ## Still failing When the previous run failed, but still not fixed Screenshot 2023-03-10 at 15 47 22 --- .github/workflows/test.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b14d4172..85ab65c7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -86,15 +86,6 @@ jobs: run: | bundle install --jobs=3 --retry=3 bundle exec rake - - - uses: 8398a7/action-slack@v3 - with: - status: ${{ job.status }} - fields: repo,message,commit,author,ref,job,took # selectable (default: repo,message) - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required - MATRIX_CONTEXT: ${{ toJson(matrix) }} # required - if: failure() && env.SLACK_WEBHOOK_URL # because continue-on-error marks the steps as pass even if they fail - name: "setup-ruby (bundle install) outcome: ${{ steps.setup-ruby.outcome }}" run: "" @@ -104,3 +95,12 @@ jobs: run: "" - name: "rack-protection tests outcome: ${{ steps.protection-tests.outcome }}" run: "" + + notify: + uses: zzak/action-discord/.github/workflows/notify.yml@main + if: ${{ github.ref_name == 'main' }} + needs: test + secrets: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + with: + result: ${{ needs.test.result }}