CI: fix up notifications to Matrix

This commit is contained in:
Adriaan de Groot 2021-05-25 15:47:44 +02:00
parent e2d6e63fe6
commit 93221da5ea
2 changed files with 8 additions and 7 deletions

View File

@ -16,4 +16,5 @@ runs:
using: "composite" using: "composite"
steps: steps:
- shell: bash - 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

View File

@ -81,18 +81,18 @@ jobs:
if: ${{ success() && github.repository == 'calamares/calamares' }} if: ${{ success() && github.repository == 'calamares/calamares' }}
uses: ./.github/actions/notify-push uses: ./.github/actions/notify-push
with: with:
TOKEN: ${{ secrets.MATRIX_TOKEN }} token: ${{ secrets.MATRIX_TOKEN }}
ROOM: ${{ secrets.MATRIX_ROOM }} room: ${{ secrets.MATRIX_ROOM }}
MESSAGE: | message: |
OK ${{ github.workflow }} in ${{ github.repository }} by ${{ github.actor }} on ${{ github.event.ref }} OK ${{ github.workflow }} in ${{ github.repository }} by ${{ github.actor }} on ${{ github.event.ref }}
.. ${{ steps.pre_build.outputs.message }} .. ${{ steps.pre_build.outputs.message }}
- name: "notify: fail" - name: "notify: fail"
if: ${{ failure() && github.repository == 'calamares/calamares' }} if: ${{ failure() && github.repository == 'calamares/calamares' }}
uses: ./.github/actions/notify-push uses: ./.github/actions/notify-push
with: with:
TOKEN: ${{ secrets.MATRIX_TOKEN }} token: ${{ secrets.MATRIX_TOKEN }}
ROOM: ${{ secrets.MATRIX_ROOM }} room: ${{ secrets.MATRIX_ROOM }}
MESSAGE: | message: |
FAIL ${{ github.workflow }} in ${{ github.repository }} by ${{ github.actor }} on ${{ github.event.ref }} FAIL ${{ github.workflow }} in ${{ github.repository }} by ${{ github.actor }} on ${{ github.event.ref }}
.. ${{ steps.pre_build.outputs.message }} .. ${{ steps.pre_build.outputs.message }}
.. ${{ github.event.compare }} .. ${{ github.event.compare }}