From 23d01bc4746c614a4e2c0ecd5ba4e89c72f7c569 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Wed, 4 Feb 2026 13:06:44 +0100 Subject: [PATCH] only notify Discord once If we're in a matrix, and one of the jobs fail, then we only want to notify Discord once instead of for each failure. --- .github/workflows/ci.yml | 8 ++++++-- .github/workflows/integration-tests.yml | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f817e05a3..fca477c08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,9 +110,13 @@ jobs: - name: Run Playwright tests run: npm run test:ui + notify: + if: ${{ always() && github.ref == 'refs/heads/main' && needs.tests.result == 'failure' }} + needs: tests + runs-on: ubuntu-latest + steps: - name: Notify Discord - if: failure() && github.ref == 'refs/heads/main' uses: discord-actions/message@v2 with: webhookUrl: ${{ secrets.DISCORD_WEBHOOK_URL }} - message: 'The [most recent build](<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>) on the `main` branch has failed.' + message: 'The [most recent ${{ github.workflow }} workflow](<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>) on the `main` branch has failed.' diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 1508c1eff..3b2cf8f1b 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -113,9 +113,13 @@ jobs: env: GITHUB_WORKSPACE: ${{ github.workspace }} + notify: + if: ${{ always() && github.ref == 'refs/heads/main' && needs.tests.result == 'failure' }} + needs: tests + runs-on: ubuntu-latest + steps: - name: Notify Discord - if: failure() && github.ref == 'refs/heads/main' uses: discord-actions/message@v2 with: webhookUrl: ${{ secrets.DISCORD_WEBHOOK_URL }} - message: 'The [most recent build](<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>) on the `main` branch has failed.' + message: 'The [most recent ${{ github.workflow }} workflow](<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>) on the `main` branch has failed.'