Skip to content

Gen5HQ/mattermost-github-watcher

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 

Repository files navigation

Post Merged PRs to Mattermost

This GitHub Action collects all pull requests merged in the last 24 hours for the current repository and posts a formatted list to a Mattermost channel via an incoming webhook.

Features

  • Uses the GitHub CLI (gh) to query merged PRs.
  • Automatically detects the current repository ($GITHUB_REPOSITORY).
  • Outputs a nicely formatted list including PR number, title, URL, and author.
  • Sends the result to Mattermost using a webhook.
  • If no PRs were merged in the last 24h, it posts a fallback message.

Inputs

Name Required Description
mattermost_webhook_url Yes Incoming webhook URL for your Mattermost channel.
gh_token Yes GitHub token (usually secrets.GITHUB_TOKEN) to authenticate with the GitHub CLI.
hours No How many hours back to search for merged PRs. (default: 24)
skip_if_no_prs No If it is true, skip sending if there is no prs

Example Usage

name: post-merged-prs
on:
  schedule:
    - cron: "0 0 * * *" # Runs daily at 00:00 UTC
  workflow_dispatch:

jobs:
  post-prs:
    runs-on: ubuntu-latest
    steps:
      - uses: Gen5HQ/mattermost-github-watcher@[version]
        with:
          mattermost_webhook_url: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
          gh_token: ${{ secrets.GITHUB_TOKEN }}

How to get MATTERMOST_WEBHOOK_URL

image image image

Output Example

If PRs were merged in the last 24h, the Mattermost message will look like:

image

If no PRs were merged:

image

Requirements

  • The GitHub CLI is preinstalled on GitHub-hosted runners.
  • This action must have permission to read pull requests. By default, secrets.GITHUB_TOKEN is sufficient.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published