Python script to send notifications to a matrix room.
  • Python 94%
  • Dockerfile 6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
bobbyblues c92e0f22eb
All checks were successful
ci/woodpecker/push/lint_docker Pipeline was successful
ci/woodpecker/push/lint_python Pipeline was successful
ci/woodpecker/push/build_docker Pipeline was successful
ci/woodpecker/push/build_docker_plugin Pipeline was successful
ci/woodpecker/tag/lint_docker Pipeline was successful
ci/woodpecker/tag/lint_python Pipeline was successful
ci/woodpecker/tag/build_docker Pipeline was successful
ci/woodpecker/tag/build_docker_plugin Pipeline was successful
fix: remove debug statement
2026-05-28 10:53:42 +02:00
.meta feat: add woodpecker plugin 2026-05-28 10:51:14 +02:00
media feat: add woodpecker plugin 2026-05-28 10:51:14 +02:00
.gitignore Initial commit 2025-05-23 22:18:02 +02:00
Containerfile feat(ci): add notification when pipeline fails. 2025-06-23 14:20:00 +02:00
docs.md docs: fix typo in logo URL 2026-05-28 10:52:57 +02:00
LICENSE Initial commit 2025-05-23 22:18:02 +02:00
matrix_notifier.py fix: remove debug statement 2026-05-28 10:53:42 +02:00
README.md feat: add woodpecker plugin 2026-05-28 10:51:14 +02:00
requirements.txt first version 2025-05-23 23:13:11 +02:00
woodpecker_plugin_Containerfile feat: add woodpecker plugin 2026-05-28 10:51:14 +02:00

matrix-notifier

Python script to send notifications to a matrix room.

Testing

To test this project you will need:

  • The id of a user on a matrix server (referred hereafter as <user_id>)
  • A token corresponding to that user (referred hereafter as <matrix_token>)
  • The url of the matrix server (referred hereafter as <server_url>)
  • The id of the room on which to send the message (referred hereafter as <room_id>)

All commands are expected to be ran from the root directory of this project.

First build the Docker image with

docker build -t matrix-notifier:latest -f ./Containerfile .

Then send a test message with:

docker run --rm -e MATRIX_TOKEN="<matrix_token>"" matrix-notifier:latest send <server_url> <user_id> <room_id> "This is a test" "<h1>This is a test</h1>"

For example with bogus values:

docker run --rm -e MATRIX_TOKEN="syt_oyEt6NzA2Waer3EF8s5vWbrRBEt88JMS_icF5ZU" matrix-notifier:latest send https://mydomain.tld botuser !tfdBxJRkuvdqD3K7Ma:mydomain.tld "This is a test" "<h1>This is a test</h1>"

Woodpecker plugin

This code can be built to work as a woodpecker plugin.

docker build -t matrix-notifier-plugin:latest -f ./woodpecker_plugin_Containerfile .

In your Woodpecker pipeline, you can integrate the following step:

  - name: Notification
    image: registry.bobbyblues.com/matrix-notifier-plugin:1.0.0
    settings:
      homeserver: https://domain.tld
      user_id: botuser
      room_id: !tfdBxJRkuvdqD3K7Ma:mydomain.tld
      message: "[CI] ⚠️ Step failed for your project."
      message_html: "[CI] ⚠️ Step failed for <a href='$CI_PIPELINE_URL'>your</a> project."
      matrix_token:
        from_secret: matrix_token

And define the matrix_token secret, containing a valid matrix token for botuser, and limiting its access to the plugin.

Plugin documentation can be found in the docs.md file.