Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
send

GitHub Action

Mattermost

1.0.3

Mattermost

send

Mattermost

Send message to your Mattermost instance

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Mattermost

uses: mattermost/[email protected]

Learn more about this action in mattermost/action-mattermost-notify

Choose a version

Mattermost Actions

GitHub Actions for automating builds, deployments, and so on.

You need generate a mattermost.json file in a step before. For the message format you can check the Mattermost documentation

Also you can check the files for example:

Environment Variables

Variable Default Purpose
MATTERMOST_WEBHOOK_URL (Mandatory) The Mattermost Incoming Webhook
MATTERMOST_CHANNEL The name of the channel you want to post, by default will post in the channel that was setup in the webhook creation
MATTERMOST_USERNAME The name of the sender of the message. ie, "GitHubAction"
MATTERMOST_ICON User/Bot icon shown with Mattermost message

You can see the action block with some variables as below:

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Create the Mattermost Message
      run: |
        echo "{\"text\":\"testing github action :tada:\"}" > mattermost.json
    - uses: mattermost/action-mattermost-notify@master
      env:
        MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}

Building

To build the action-mattermost-notify app, use the Dockerfile:

podman build . -f ./Dockerfile -t action-mattermost-notify:local

Or just build with:

go build -mod=vendor -o action-mattermost-notify .