Woodpecker CI Plugins
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

wp-matrix

Build Status Docker Hub Quay.io Go Report Card GitHub contributors Source: GitHub License: Apache-2.0

Woodpecker CI plugin to send messages to a Matrix room.

Usage

steps:
- name: notify
  image: quay.io/thegeeklab/matrix
  settings:
    homeserver: https://matrix.org
    room_id: randomstring:matrix.org
    username: octocat
    password: random-secret

Parameters

access_token optional string
Authentication access token.
Default: none
homeserver optional string
Matrix home server url.
Default: https://matrix.org
insecure_skip_verify optional bool
Skip SSL verification.
Default: false
log_level optional string
Plugin log level.
Default: info
password optional string
Authentication password.
Default: none
room_id optional string
Room ID to send messages to.
Default: none
template optional string

Golang template for the message.

The Metadata struct is exposed to the template and all fields can be referenced. To extend the functionality, sprig functions can also be used.

Default: Status: **{{ .Pipeline.Status }}** Build: [{{ .Repository.Slug }}]({{ .Pipeline.URL }}){{ if .Curr.Branch }} ({{ .Curr.Branch }}){{ end }} by {{ .Curr.Author.Name }} Message: {{ .Curr.Title }}{{ if .Curr.URL }} ([source]({{ .Curr.URL }})){{ end }}
template_unsafe optional bool

Render raw HTML and potentially dangerous links in template.

By default, raw HTML and potentially dangerous links in the template are not rendered. If inline HTML is used, it may be necessary to activate this option. In such cases, please ensure that the CI configuration files in the git repository are protected against malicious changes.

Default: false
user_id optional string

Authentication user ID.

If set, the access_token parameter is required as well.

Default: none
username optional string

Authentication username.

If set, the password parameter is required as well.

Default: none

Build

Build the binary with the following command:

make build

Build the container image with the following command:

docker build --file Containerfile.multiarch --tag thegeeklab/wp-matrix .

Test

docker run --rm \
  -e PLUGIN_ROOM_ID=randomstring:matrix.org \
  -e PLUGIN_USERNAME=octocat \
  -e PLUGIN_PASSWORD=random-secret \
  -v $(pwd):/build:z \
  -w /build \
  thegeeklab/wp-matrix