Skip to content
message-square

GitHub Action

Mattermost Notify

v0.1.6 Latest version

Mattermost Notify

message-square

Mattermost Notify

Notification from Mattermost or Slack about successful deployments and rollbacks

Installation

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

              

- name: Mattermost Notify

uses: valitydev/action-mattermost-notify@v0.1.6

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

Choose a version

Mattermost Deployment Notification Action

Notification of Mattermost (or Slack):

  • After PR's merge into main branch and successful deployment
  • After PR's rollback (when you call the deployment action again not on the last PR)

The message contains:

  • Author
  • Repository
  • PR title
  • PR comment
  • Commit ID

Only successful rollouts

Note

Action idea in notifications about successfully deployments when you want to know what rolled out and rolled back on your main channel (therefore it does not support spam notifications about crashes)

If you need to notify everything, then you can use rtCamp/action-slack-notify, on which this project is based

Usage

# .github/workflows/main.yaml

name: Main
on:
  push:
    branches: ["master", "main"]
jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npm run build
      - name: Deploy
        run: echo deploy
  notify:
    name: Notify
    runs-on: ubuntu-latest
    needs: [deploy] # We are waiting for a successful rollout
    steps:
      - uses: actions/checkout@v4
      - uses: valitydev/action-mattermost-notify@latest
        with:
          webhook: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
          channel: "dashboard-deployments" # link path param
          username: "Frontend"

Configuration

webhook:
  description: Mattermost webhook
  required: true
channel:
  description: Channel path name
  required: false
  default: ""
username:
  description: Username
  required: false
  default: "Deploy"
iconEmoji:
  description: Icon emoji
  required: false
  default: ":tractor:"