Skip to main content

Python tool to post GitHub Action runs to mattermost

Project description

Greenbone Logo

mattermost-notify

GitHub releases PyPI release code test coverage Build and test

This tool is desired to post messages to a mattermost channel. You will need a mattermost webhook URL and give a channel name.

Table of Contents

Installation

Requirements

Python 3.7 and later is supported.

Install using pip

pip 19.0 or later is required.

You can install the latest stable release of mattermost-notify from the Python Package Index (pypi) using [pip]

python3 -m pip install --user mattermost-notify

Usage

Print a free text message:

mnotify-git <hook_url> <channel> --free "What a pitty!"

Print a github workflow status (legacy long/short templates):

mnotify-git <hook_url> <channel> -S [success, failure, warning] -r <orga/repo> -b <branch> -w <workflow_id> -n <workflow_name>

Notification templates

--notification-type is optional. Use it only when you want a specific template (deployment, service-update, stage-transition, release, hotfix) and you are passing deployment metadata.

Supported types:

  • deployment
  • service-update
  • stage-transition
  • release
  • hotfix

Deployment

mnotify-git <hook_url> <channel> \
  --notification-type deployment \
  --product <product> \
  --stage <stage> \
  -S [success, failure, warning] \
  -r <orga/repo> -b <branch> -w <workflow_id> -n <workflow_name>

Service update

mnotify-git <hook_url> <channel> \
  --notification-type service-update \
  --service <service> \
  --version <version> \
  -S [success, failure, warning] \
  -r <orga/repo> -b <branch> -w <workflow_id> -n <workflow_name>

Stage transition

mnotify-git <hook_url> <channel> \
  --notification-type stage-transition \
  --product <product> \
  --from-stage <from_stage> \
  --to-stage <to_stage> \
  -S [success, failure, warning] \
  -r <orga/repo> -b <branch> -w <workflow_id> -n <workflow_name>

Release

mnotify-git <hook_url> <channel> \
  --notification-type release \
  --product <product> \
  --version <version> \
  -S [success, failure, warning] \
  -r <orga/repo> -b <branch> -w <workflow_id> -n <workflow_name>

Hotfix

mnotify-git <hook_url> <channel> \
  --notification-type hotfix \
  --product <product> \
  --version <version> \
  -S [success, failure, warning] \
  -r <orga/repo> -b <branch> -w <workflow_id> -n <workflow_name>

Optional metadata flags

--product <name>
--stage <stage>
--version <version>
--service <service>
--from-stage <stage>
--to-stage <stage>
--notification-type <deployment|service-update|stage-transition|release|hotfix>

If no deployment metadata is provided, the tool falls back to the legacy long/short templates.

License

Copyright (C) 2021-2022 Jaspar Stach

Licensed under the GNU General Public License v3.0 or later.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mattermost_notify-26.1.2.tar.gz (52.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mattermost_notify-26.1.2-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file mattermost_notify-26.1.2.tar.gz.

File metadata

  • Download URL: mattermost_notify-26.1.2.tar.gz
  • Upload date:
  • Size: 52.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mattermost_notify-26.1.2.tar.gz
Algorithm Hash digest
SHA256 cf761d1a078c91dc310b64396c2a77489bc7304e667c378871936804fbd8d906
MD5 17743415ece94e84c0a4f8b4f91ef16b
BLAKE2b-256 b6ab01598f9d3ade80e8cb7b2d1b9a01d765c443661c001fc27f5aac12b36e68

See more details on using hashes here.

Provenance

The following attestation bundles were made for mattermost_notify-26.1.2.tar.gz:

Publisher: deploy-pypi.yml on greenbone/mattermost-notify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mattermost_notify-26.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mattermost_notify-26.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 506f0df85dbc505cf6a54547e0d80d706f0d16f67a5bbac2c865ad1338a2d7cb
MD5 fed9375675f8df652257783717fd346d
BLAKE2b-256 9bc5916d3a7864f02bd3416bfa300a4e96525d768730a1cfd04a80394c5452ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for mattermost_notify-26.1.2-py3-none-any.whl:

Publisher: deploy-pypi.yml on greenbone/mattermost-notify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page