Skip to main content

Connect GitHub to Mattermost

Minimize distractions and reduce context switching between your GitHub code repositories and your communication platform by integrating GitHub with Mattermost. Help your teams stay focused and productive with real-time updates on commits, pull requests, issues, and more directly from Mattermost channels.

An example of the GitHub integration for Mattermost.

Deploy

A Mattermost system admin must perform the following steps to deploy the GitHub integration.

Install the integration

  1. In Mattermost, from the Product menu Navigate between Channels, collaborative playbooks, and boards using the product menu icon., select App Marketplace.
  2. Search for or scroll to GitHub, and select Install.

Set up the integration

You can configure the GitHub integration using either the built-in setup wizard (recommended) or by following the manual configuration steps.

The recommended way to configure the GitHub integration is using the built-in setup wizard. The wizard guides you through each step of the configuration process, including creating the OAuth app and webhook in GitHub.

  1. In any Mattermost channel, run the /github setup slash command.
  2. Follow the interactive prompts to complete the setup.

The wizard walks you through:

  • Creating and configuring an OAuth app in GitHub
  • Setting up the webhook connection between GitHub and Mattermost
  • Announcing the integration to your team

You can also run individual setup steps at any time using the following subcommands:

  • /github setup oauth: Configure the OAuth2 application in GitHub.
  • /github setup webhook: Create a webhook from GitHub to Mattermost.
  • /github setup announce: Announce the integration availability to designated channels.

Upgrade

We recommend updating this integration as new versions are released. Generally, updates are seamless and don't interrupt the user experience in Mattermost. Visit the Releases page for the latest release, available releases, and compatibiilty considerations.

Enable

Once you setup the integration, notify your teams that they can connect their GitHub accounts to Mattermost.

Use

Users who want to use GitHub interconnectivity must connect their GitHub account to Mattermost.

Once connected, you'll receive direct messages from the GitHub bot in Mattermost when someone mentions you, requests a review, comments on, modifies one of your pull requests/issues (includes adding labels or reopening the issue), or assigns you to an issue on GitHub.

Connect a GitHub account to Mattermost

  1. In Mattermost, run the /github connect slash command in any Mattermost channel to link your Mattermost account with your GitHub account.
  2. Once connected, run the /github help slash command to see what you can do.

Get started

Here are some common slash commands you can get started with:

Run the /github subscriptions add slash command to subscribe a Mattermost channel to receive notifications for new pull requests, issues, branch creation, and more in a GitHub repository.

For example, to post notifications for issues, issue comments, and pull requests matching the label Help Wanted from the mattermost/mattermost-server GitHub repository, use: /github subscriptions add mattermost/mattermost-server --features issues,pulls,issue_comments,label:"Help Wanted". The following flags are supported:

  • --features: A comma-delimited list of one or more of: issues, pulls, pulls_merged, pulls_created, pushes, creates, deletes, issue_creations, issue_comments, pull_reviews, releases, workflow_success, workflow_failure, discussions, discussion_comments, label:"labelname". Defaults to pulls,issues,creates,deletes.
  • --exclude-org-member: The events triggered by organization members that won't be delivered. It will be locked to the organization configured and only works for users whose membership is public. Organization members and collaborators are not the same.
  • --include-only-org-members: events triggered only by organization members will be delivered. It will be locked to the organization provided in the plugin configuration and it will only work for users whose membership is public. Note that organization members and collaborators are not the same.
  • --render-style: Notifications are delivered in the specified style (for example, the body of a pull request will not be displayed). Supported values are collapsed, skip-body, or default (which is the same as omitting the flag).
  • --exclude: A comma-separated list of the repositories to exclude from getting the subscription notifications like mattermost/mattermost-server. Only supported for subscriptions to an organization.

Run the /github todo slash command to get a message with items to do in GitHub, including a list of unread messages and pull requests awaiting your review.

Run the /github settings slash command to update your settings for notifications and daily reminders.

Run the /github mute slash command to manage muted GitHub users. You won't receive notifications for comments in your pull requests and issues from muted users.

Run the /github default-repo slash command to set a default repository for the current channel. This repository will be auto-filled in the Create GitHub Issue modal for convenience.

Frequently asked questions

How do I connect a repository instead of an organization?

Set up your GitHub webhook from the repository instead of the organization. Notifications and subscriptions will then be sent only for repositories you create webhooks for. The reminder and /github todo searches the whole organization, but only show items assigned to you.

How do I send notifications when a certain label is applied?

If you want to send notifications to a Mattermost channel when Severity/Critical label is applied to any issue in the mattermost/mattermost-plugin-github repository, run the following slash command to subscribe to these notifications: /github subscriptions add mattermost/mattermost-plugin-github issues,label:"Severity/Critical"

How does the integration save user data for each connected GitHub user?

GitHub user tokens are AES-encrypted with an At Rest Encryption Key generated in Mattermost. Once encrypted, the tokens are saved in the PluginKeyValueStore table in your Mattermost database.

Get help

Mattermost customers can open a Mattermost support case. To report a bug, please open a GitHub issue against the Mattermost GitHub plugin repository.

For questions, feedback, and assistance, join our pubic Integrations and Apps channel on the Mattermost Community Server for assistance.

Mattermost Team Edition and Free customers can visit the Mattermost peer-to-peer troubleshooting forum to access the global Mattermost Community for assistance.