CI: try to use actions-metadata rather than local script
This commit is contained in:
parent
c333b9bb0a
commit
5bf118409a
20
.github/actions/notify-push/action.yml
vendored
Normal file
20
.github/actions/notify-push/action.yml
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
name: 'Notify on Push'
|
||||||
|
description: 'Notify Matrix room'
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
room:
|
||||||
|
description: 'Matrix Room ID'
|
||||||
|
required: true
|
||||||
|
token:
|
||||||
|
description: 'Matrix Token'
|
||||||
|
required: true
|
||||||
|
message:
|
||||||
|
description: 'Message to send'
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- shell: bash
|
||||||
|
run: |
|
||||||
|
curl -s -XPOST -d $( echo "$INPUT_MESSAGE" | jq -Rs '{"msgtype": "m.text", "body":@text}' ) "https://matrix.org/_matrix/client/r0/rooms/%21${INPUT_ROOM}/send/m.room.message?access_token=${INPUT_TOKEN}" > /dev/null
|
29
.github/workflows/push.yml
vendored
29
.github/workflows/push.yml
vendored
@ -79,19 +79,20 @@ jobs:
|
|||||||
run: make install VERBOSE=1
|
run: make install VERBOSE=1
|
||||||
- name: "notify: ok"
|
- name: "notify: ok"
|
||||||
if: ${{ success() && github.repository == 'calamares/calamares' }}
|
if: ${{ success() && github.repository == 'calamares/calamares' }}
|
||||||
env:
|
uses: ./.github/actions/notify-push
|
||||||
MATRIX_TOKEN: ${{ secrets.MATRIX_TOKEN }}
|
with:
|
||||||
MATRIX_ROOM: ${{ secrets.MATRIX_ROOM }}
|
TOKEN: ${{ secrets.MATRIX_TOKEN }}
|
||||||
run: |
|
ROOM: ${{ secrets.MATRIX_ROOM }}
|
||||||
"$SRCDIR/ci/notify.sh" OK '${{ github.workflow }}' '${{ github.repository }}' '${{ github.actor }}' '${{ github.event.ref }}' \
|
MESSAGE: |
|
||||||
'${{ steps.pre_build.outputs.message }}' \
|
OK ${{ github.workflow }} in ${{ github.repository }} by ${{ github.actor }} on ${{ github.event.ref }}
|
||||||
''
|
.. ${{ steps.pre_build.outputs.message }}
|
||||||
- name: "notify: fail"
|
- name: "notify: fail"
|
||||||
if: ${{ failure() && github.repository == 'calamares/calamares' }}
|
if: ${{ failure() && github.repository == 'calamares/calamares' }}
|
||||||
env:
|
uses: ./.github/actions/notify-push
|
||||||
MATRIX_TOKEN: ${{ secrets.MATRIX_TOKEN }}
|
with:
|
||||||
MATRIX_ROOM: ${{ secrets.MATRIX_ROOM }}
|
TOKEN: ${{ secrets.MATRIX_TOKEN }}
|
||||||
run: |
|
ROOM: ${{ secrets.MATRIX_ROOM }}
|
||||||
"$SRCDIR/ci/notify.sh" FAIL '${{ github.workflow }}' '${{ github.repository }}' '${{ github.actor }}' '${{ github.event.ref }}' \
|
MESSAGE: |
|
||||||
'${{ steps.pre_build.outputs.message }}' \
|
FAIL ${{ github.workflow }} in ${{ github.repository }} by ${{ github.actor }} on ${{ github.event.ref }}
|
||||||
'${{ github.event.compare }}'
|
.. ${{ steps.pre_build.outputs.message }}
|
||||||
|
.. ${{ github.event.compare }}
|
||||||
|
Loading…
Reference in New Issue
Block a user