From c57d22a72c8bfb1b38ec0d62e9b46e1550bbd142 Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Thu, 10 Mar 2022 16:41:00 +0000 Subject: [PATCH] Additionally notify the matrix channel if these tests fail when run after merge to develop or main. --- .github/workflows/tests.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 18c225ad30..74f31f4888 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -85,3 +85,21 @@ jobs: ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository ) with: files: ./**/build/test-results/**/*.xml + +# Notify the channel about runs against develop or main that have failures, as PRs should have caught these first. + notify: + runs-on: ubuntu-latest + needs: + - unit-tests + - build-android-test-matrix-sdk + - build-android-test-app + if: ${{ (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' ) && failure() }} + steps: + - uses: michaelkaye/matrix-hookshot-action@v0.3.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + matrix_access_token: ${{ secrets.ELEMENT_ANDROID_NOTIFICATION_ACCESS_TOKEN }} + matrix_room_id: ${{ secrets.ELEMENT_ANDROID_INTERNAL_ROOM_ID }} + text_template: "Build is broken for ${{ github.ref }} 🎊: {{#each job_statuses }}{{#with this }}{{#if completed }} {{name}} {{conclusion}} at {{completed_at}}, {{/if}}{{/with}}{{/each}}" + html_template: "Build is broken for ${{ github.ref }} 🎊: {{#each job_statuses }}{{#with this }}{{#if completed }}
{{icon conclusion }}{{name}} {{conclusion}} at {{completed_at}} [details]{{/if}}{{/with}}{{/each}}" +