From 93221da5ead59f7cda84a081e3c608e2b60546e3 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 25 May 2021 15:47:44 +0200 Subject: [PATCH] CI: fix up notifications to Matrix --- .github/actions/notify-push/action.yml | 3 ++- .github/workflows/push.yml | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/actions/notify-push/action.yml b/.github/actions/notify-push/action.yml index 56cdbf7c6..ca4e6c0b2 100644 --- a/.github/actions/notify-push/action.yml +++ b/.github/actions/notify-push/action.yml @@ -16,4 +16,5 @@ runs: using: "composite" steps: - shell: bash - run: echo "$INPUT_MESSAGE" + run: | + curl -s -XPOST -d $( echo "${{ inputs.message }}" | jq -Rs '{"msgtype": "m.text", "body":@text}' ) "https://matrix.org/_matrix/client/r0/rooms/%21${{ inputs.room }}/send/m.room.message?access_token=${{ inputs.token }}" > /dev/null diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 4ab250158..c5f02c625 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -81,18 +81,18 @@ jobs: if: ${{ success() && github.repository == 'calamares/calamares' }} uses: ./.github/actions/notify-push with: - TOKEN: ${{ secrets.MATRIX_TOKEN }} - ROOM: ${{ secrets.MATRIX_ROOM }} - MESSAGE: | + token: ${{ secrets.MATRIX_TOKEN }} + room: ${{ secrets.MATRIX_ROOM }} + message: | OK ${{ github.workflow }} in ${{ github.repository }} by ${{ github.actor }} on ${{ github.event.ref }} .. ${{ steps.pre_build.outputs.message }} - name: "notify: fail" if: ${{ failure() && github.repository == 'calamares/calamares' }} uses: ./.github/actions/notify-push with: - TOKEN: ${{ secrets.MATRIX_TOKEN }} - ROOM: ${{ secrets.MATRIX_ROOM }} - MESSAGE: | + token: ${{ secrets.MATRIX_TOKEN }} + room: ${{ secrets.MATRIX_ROOM }} + message: | FAIL ${{ github.workflow }} in ${{ github.repository }} by ${{ github.actor }} on ${{ github.event.ref }} .. ${{ steps.pre_build.outputs.message }} .. ${{ github.event.compare }}