A very simple bash script that can be used to send a message to a Matrix room. Probably broken in ways that I have not experienced
 
 
Go to file
Bruno BELANYI 436483aac7
ci/woodpecker/push/check Pipeline was successful Details
ci/woodpecker/manual/check Pipeline was successful Details
ci: remove Drone CI
2023-04-14 16:07:37 +00:00
.woodpecker ci: add Woodpecker CI workflow 2023-04-14 16:07:37 +00:00
.envrc nix: evaluate shell hooks 2021-06-12 00:39:58 +02:00
.gitignore git: ignore generated pre-commit configuration 2021-06-12 00:39:42 +02:00
README.md doc: mention pandoc formatting 2021-06-16 21:14:22 +02:00
flake.lock nix: add flake 2021-06-12 00:39:22 +02:00
flake.nix flake: bump version to v0.3.0 2023-03-18 12:48:28 +00:00
matrix-notifier matrix-notifier: add woodpecker integration 2023-03-18 12:46:36 +00:00

README.md

matrix-notifier

This is a simple to send a message to a Matrix room. It automatically logs in and sends the message when invoked. This was written to be used a notification script in my CI/CD pipelines.

How to use

You need to define the following environment variables for the script to be executed correctly:

  • USER: the user to login as.
  • PASS: the password to login with.
  • ADDRESS: the address of the homeserver to connect to.
  • ROOM: the room id, as can be found in the room parameters.
  • MESSAGE: the message you wish to send to the room.

Example

export ADDRESS='https://matrix.org'
export USER='username'
export PASS='password'
export ROOM='!aaaaaaaaaaaaaaaaaa:matrix.org'
export MESSAGE='This is my test message'
./matrix-notifier

How to run/install

This script is packaged with Nix, you can just use nix run . to run it.

The only dependencies are bash, curl, and jq, install those and you should be ready to go! Format is needed when using formatting (enabled by default).