From a632f9b1ef152c2d0b6f4c452fb323d534116e01 Mon Sep 17 00:00:00 2001 From: Dan Baker Date: Sat, 4 Mar 2023 22:08:30 -0800 Subject: [PATCH] workflow/update-daily-test-messaging2 (#449) * Fix room ID. * Add a nicer message to be sent to matrix. * Fixing context variable names. * changed base_ref to ref to get the branch that triggered the action. * Add formatting to message. * Add more formatting to message. * Add more(x2) formatting to message. * typo * I can't believe it's more formatting. * Introduce a failure to make sure CI and daily tests work. * Always send a message to Matrix even when previous step fails. * Fixing formatting for daily test failure. * add emoji so success/failure stands out more. * Maybe actual emojis work instead of their short codes? * Remove the previously injected error. * Fixing success case for emoji. --- .github/workflows/daily-test.yml | 33 ++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/daily-test.yml b/.github/workflows/daily-test.yml index d06a5471..33813f48 100644 --- a/.github/workflows/daily-test.yml +++ b/.github/workflows/daily-test.yml @@ -31,12 +31,41 @@ jobs: cd example/ nix build + - name: Get current date + id: date + if: always() + run: echo "::set-output name=date::$(TZ=GMT date +'%Y-%m-%d %H:%M:%S %Z')" + + - name: Get status + id: status + if: always() + uses: ASzc/change-string-case-action@v5 + with: + string: ${{ job.status }} + + - name: Get status emoji + id: status_emoji + if: always() + uses: haya14busa/action-cond@v1 + with: + cond: ${{ steps.status.outputs.lowercase == 'success' }} + if_true: "🎉" + if_false: "💩" + - name: Send message to matrix id: matrix-chat-message + if: always() uses: fadenb/matrix-chat-message@v0.0.6 with: homeserver: 'matrix.org' token: ${{ secrets.MATRIX_TOKEN }} - channel: '' + channel: '!JVjIaYhrLXOiLWJfnL:matrix.org' message: | - ${{ job.status }} + ${{ steps.status_emoji.outputs.value }} ***${{ steps.status.outputs.uppercase }}***\ + Workflow ***${{ github.workflow }}***\ + Job ***${{ github.job }}***\ + Triggered by ***${{ github.event_name }}***\ + For `${{ github.ref }}`\ + On `${{ github.sha }}`\ + At ${{ steps.date.outputs.date }}\ + With schedule `${{ github.event.schedule }}`