A Github Action to report the result of a workflow run to a matrix room.
name: verify
on: push
jobs:
verify:
runs-on: ubuntu-20.04
steps:
- uses: Numericas/matrix-action@v1
with:
server: ${{ secrets.MATRIX_SERVER }}
room-id: ${{ secrets.MATRIX_ROOM_ID }}
user: ${{ secrets.MATRIX_USER }}
password: ${{ secrets.MATRIX_PASSWORD }}
status: ${{ job.status }}
If you just want to report specific build results use the if
directive as shown below, together with the success()
, failure()
and cancelled()
function.
name: verify
on: push
jobs:
verify:
runs-on: ubuntu-20.04
steps:
- uses: Numericas/matrix-action@v1
with:
server: ${{ secrets.MATRIX_SERVER }}
room-id: ${{ secrets.MATRIX_ROOM_ID }}
user: ${{ secrets.MATRIX_USER }}
password: ${{ secrets.MATRIX_PASSWORD }}
status: ${{ job.status }}
if: failure()
You can provide a custom message via the message
input.
name: verify
on: push
jobs:
verify:
runs-on: ubuntu-20.04
steps:
- uses: Numericas/matrix-action@v1
with:
server: ${{ secrets.MATRIX_SERVER }}
room-id: ${{ secrets.MATRIX_ROOM_ID }}
user: ${{ secrets.MATRIX_USER }}
password: ${{ secrets.MATRIX_PASSWORD }}
status: ${{ job.status }}
message: Integration tests failed
if: failure()
It is also possible to authenticate to matrix via an access token, but since this will/should expire for security reasons user
& password
is recommended.
name: verify
on: push
jobs:
verify:
runs-on: ubuntu-20.04
steps:
- uses: Numericas/matrix-action@v1
with:
server: ${{ secrets.MATRIX_SERVER }}
room-id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
status: ${{ job.status }}
message: Integration tests failed
if: failure()