Mattermost GitHub and GitLab integrations

Connecting GitHub or self-managed GitLab to a self-hosted Mattermost server brings pull request, merge request, issue and pipeline events into channels through OAuth apps and webhooks. This page covers how to build it and what to check.

On this page

How Mattermost connects to GitHub and GitLab for channel notifications

An engineering or platform team that wants pull request, merge request, issue and pipeline activity in Mattermost channels, while the server stays in its own infrastructure, should use the documented Mattermost GitHub and GitLab integrations. Each one connects through an OAuth app and webhooks that you create on the source platform and register with your self-hosted Mattermost server. Nothing in this path requires the code platform to send data to a Mattermost-hosted service, so the decision you are making is about who operates each side of the connection, not whether the feature exists.

For GitHub, the Mattermost integration can be configured in two ways: through a /github setup wizard inside Mattermost that walks you through creating the GitHub OAuth app and webhook, or manually, by creating those objects yourself and entering the values. The wizard is usually the faster path for a first channel, while the manual path gives your administrators direct control over the app registration and the webhook secret. Confirm which GitHub organization or account will own the OAuth app, since that owner controls who can revoke or rotate it later.

GitLab is supported in both forms: GitLab SaaS and on-premises GitLab. The Mattermost GitLab integration posts notifications for events such as merges, issue comments and merge request comments into the channels you subscribe. If you run self-managed GitLab, confirm that your Mattermost server can reach the GitLab instance over the network path you intend to use, and that the GitLab instance can reach the Mattermost webhook endpoint, because both directions matter for delivery. Check the exact event list for your Mattermost version in the Mattermost GitLab integration guide before you promise a specific notification set to the engineering team, since event coverage is the detail most likely to differ from what teams assume.

What you need before connecting GitHub or GitLab to Mattermost

Most failed integration attempts trace back to a missing prerequisite rather than a configuration error. The cards below cover what must be in place on the Mattermost server, the source system, the network and the certificates before anyone starts the OAuth app and webhook steps.

A running self-hosted Mattermost server

Confirm that the Mattermost server is installed, reachable and healthy before you touch GitHub or GitLab. The integration posts events to your Mattermost server, so an unstable server or an unfinished installation will show up as failed webhook deliveries that look like integration faults. Check the server version against the Mattermost releases page, because support windows differ between monthly releases and Extended Support Releases.

Mattermost release docs

An administrator account on Mattermost

The integration settings in Mattermost must be enabled by a system administrator, so the person doing the setup needs admin rights or must coordinate with someone who has them. Agree in advance who will enable the integration settings, who holds the resulting OAuth or webhook values, and who will receive the setup notices. Confirm this before scheduling the change window.

Permission to create OAuth apps and webhooks

On the source side, you need rights to register an OAuth application and create a webhook. In GitHub this is typically tied to the organization or repository owner. In GitLab it depends on whether the instance is SaaS or self-managed and on the group or project role. Confirm with the repository owners which account will create the OAuth app, because the application is tied to that account and its access.

Network path from the source to Mattermost

The source system must be able to send HTTPS requests to your Mattermost URL. For GitHub, that usually means internet-facing delivery unless your GitHub Enterprise Server runs inside your network. For self-managed GitLab, the GitLab server must reach Mattermost directly. Check firewalls, proxies, egress rules and any allowlist that sits between the two systems. In air-gapped sites, confirm that the source and Mattermost share a route before planning anything else.

TLS certificates the source can trust

Webhook calls fail if the source system does not trust the certificate chain on your Mattermost URL. Use a certificate issued by a public or internal authority that the source already trusts, and confirm the full chain is served, not only the leaf certificate. If your organization uses a private certificate authority, confirm that the GitLab server or any relay trusts it. Test with a plain HTTPS request from the source network before creating the webhook.

GitLab instance type and version

Decide early whether you are connecting GitLab SaaS or a self-managed GitLab instance, because the setup steps and the network path differ. For self-managed GitLab, record the exact instance URL and the version in use, and confirm that it is supported by Mattermost's GitLab integration documentation. Also confirm whether your GitLab is inside an air-gapped network, since outbound calls may not be possible.

Mattermost GitLab docs

Plan availability on your Mattermost edition

Plan availability for integrations and related features should be confirmed against the Mattermost pricing page before you commit to a design. Public pricing does not list prices, so ask your Mattermost contact to confirm in writing which plan includes the integrations you need. Check this alongside your license, because the plan determines features such as SSO and high availability that affect how you deploy the server.

Mattermost pricing

Configuring the GitHub and GitLab integrations in order

This sequence takes you from a self-hosted Mattermost server with the integration enabled to verified event delivery from GitHub or GitLab into a named channel. Run each source as its own pass so a failure in one does not hide problems in the other.

  1. Confirm server access and choose the source and channel

    A Mattermost system administrator confirms who will own the integration, which source (GitHub, GitLab SaaS or self-managed GitLab) applies, and which channel will receive events. Record the public Mattermost server URL, because the source must be able to reach it for webhooks and OAuth callbacks. Confirm the channel's membership and access rules before any events flow, since private repository activity may appear there. The step is done when the owner, source, channel and server URL are written down and agreed.

  2. Enable the integration in the system console

    In the Mattermost System Console, a system administrator turns on the GitHub or GitLab integration, which exposes the settings the source-side app will need. Check the integration's enabled state and whether custom slash commands and integration types are permitted by your policy, because the GitHub setup relies on the /github command. The step is done when the integration section shows as enabled and the administrator can see the relevant OAuth and webhook settings in the console.

  3. Create the GitHub OAuth app and webhook

    For GitHub, run the /github setup wizard in the target channel or follow the manual steps in the Mattermost GitHub documentation. The wizard walks through creating the GitHub OAuth app and webhook, and you enter the callback URL that points back to your Mattermost server. Use an account that has admin rights on the organization or repository, and register the callback exactly as the wizard shows it. The step is done when the OAuth app exists in GitHub with the correct callback URL and the webhook is listed on the repository or organization.

  4. Create the GitLab OAuth application and webhook

    For GitLab SaaS or self-managed GitLab, create an OAuth application in GitLab with the redirect URI that Mattermost's GitLab integration documents, and note the application ID and secret. Enter those values in the Mattermost integration settings, then create the project or group webhook that sends merge request, issue and comment events to Mattermost. On self-managed GitLab, confirm that outbound requests to your Mattermost URL are permitted by your network and that the GitLab administrator allows webhooks to that host. The step is done when GitLab shows the application and webhook, and Mattermost shows the connection as configured.

  5. Subscribe the events you need

    Choose the event types to deliver, such as pull or merge request activity, issue events, comments, pipeline results and merges, and enable only those in the source webhook. Both integrations support notifications for merges and comments, so match the subscription list to what the channel's members should see rather than enabling everything. Record the event list so a later review can confirm the scope. The step is done when the webhook's event list in the source matches the written list.

  6. Connect the channel and set subscriptions in Mattermost

    In the target channel, complete the connection for the chosen repository or project and confirm which events post there. If several repositories feed one channel, record which ones, because mixed activity makes triage harder. Check that the channel's members are the people expected to see these events. The step is done when the channel shows the subscription for the chosen repository or project and the subscription list in Mattermost matches the source.

  7. Send a test event and verify delivery

    Trigger a controlled event, such as a test comment on a non-production merge request or issue, and confirm the message appears in the intended channel within the normal delivery window. If nothing appears, open the webhook's recent deliveries page in GitHub or GitLab and read the response code and error text for the failed request. A 4xx or 5xx response or a connection error usually points to a wrong callback URL, an unreachable Mattermost server or a token problem. The step is done when a test event posts in the right channel and the source shows a successful delivery for it.

How pull request, merge request and pipeline events reach a channel

Each event starts at the source. When a pull request, merge request or issue changes in GitHub or GitLab, the platform sends a webhook to the Mattermost endpoint configured for that integration. Mattermost checks the incoming event against the subscription you set up, which records the repository, the event types you chose and the channel they map to. If the event matches a subscription, Mattermost posts a message to the mapped channel. If nothing matches, the event is dropped, so a missing message is often a subscription problem rather than a delivery failure. For GitHub, the setup wizard run with /github creates the OAuth app and webhook for you, or you can create them by hand from the Mattermost GitHub docs. For GitLab, confirm the webhook and token settings on both the GitLab project and the Mattermost side before you rely on them, since the steps differ between GitLab SaaS and on-premises GitLab.

OAuth authorization ties the integration's actions to a specific Mattermost user and their repository permissions. The person who completes the authorization becomes the identity Mattermost uses when it reads from or acts on the repository, so a notification or command can only expose what that account can already see. Decide which accounts authorize shared integrations, and prefer a service-style account with a documented owner over a personal account that someone may leave. When the authorizing user leaves the organization, is deactivated or loses access to a repository, the integration's API calls can fail or stop returning data for that repository. Plan a re-authorization step and an owner review as part of offboarding, and test that a change in repository access is reflected in what the channel receives.

Scope the claims you make to the documented notification types: merges, issue comments and merge request comments for GitLab, and the pull request and issue activity described in the GitHub docs. Do not assume pipeline events are covered for either source. Pipeline and CI status coverage can differ between GitHub and GitLab and between Mattermost versions, so check the current Connect GitHub and Connect GitLab pages before you promise a channel will show pipeline results. Run a test with a sample merge request and a failing pipeline, confirm each event type lands in the expected channel, and record the gaps so the team knows which build notifications need another route.

Mapping source events, channels and identities

This table maps each GitHub and GitLab event type to its Mattermost destination, the account that authorized the connection, and who may change the subscription. Read each row as a routing decision to confirm before go-live. Events marked for confirmation are not listed in the supplied vendor material, so check them in the Mattermost docs before relying on them.

Event and sourceMattermost destinationIdentity usedWho may change the subscription
GitHub: pull request, review and issue eventsChannel selected in the /github setup wizard or manual configurationGitHub account that created the OAuth app and webhookConfirm in the Mattermost GitHub docs which roles can run subscription commands
GitHub: pipeline or check status eventsConfirm whether a channel subscription option existsSame GitHub OAuth authorization as repository eventsConfirm coverage in vendor docs before promising these alerts
GitLab: merge request and merge eventsChannel chosen during GitLab connection setupGitLab user who authorized the Mattermost app for the projectConfirm whether channel admins or only the connecting user can change it
GitLab: issue and merge request comment eventsChannel chosen during GitLab connection setupSame GitLab authorization as merge eventsConfirm the same permission model as merge events in vendor docs
GitLab: pipeline status eventsConfirm whether pipeline events are supported in the Mattermost GitLab integrationGitLab user with access to the project's pipelinesConfirm coverage in vendor docs; do not assume pipeline alerts
Repository or project scopeOne subscription per repository or project is the expected pattern, to confirmAccount must have read access to every repository it subscribes toConfirm whether group-level scope is supported for either platform
SaaS or self-managed GitLab endpointConfigured server URL in the Mattermost GitLab integration settingsAccount on the same GitLab instance that hosts the projectConfirm the self-managed URL and TLS settings with your GitLab administrator

Securing OAuth apps, webhook secrets and channel access

Source control and CI events carry code, review comments and security findings into chat, so the OAuth apps, webhook secrets and channel subscriptions behind them need the same care as the repositories themselves. The cards below cover the decisions and checks that connect the GitHub or GitLab side to the Mattermost administration controls you run.

Scope the OAuth app narrowly

Create the GitHub OAuth app or GitLab application with the smallest access the notifications need, and limit it to the repositories or projects whose events the channels should see. Ask the source control owner which organizations, groups and projects the app can read, and whether an account-level app or a user-managed app better matches who owns those repositories. Record the chosen scope in your integration runbook so a later reviewer can compare it with what the app actually reads.

GitHub integration docs

Rotate client secrets and webhook tokens

The OAuth client secret and the webhook secret are long-lived credentials that can post into Mattermost or read repository activity. Set a rotation schedule with the people who own the GitHub or GitLab side, and make rotation a documented procedure that updates both the source control application and the Mattermost configuration in the same change window. Confirm with the vendor documentation how each secret is replaced, and whether old values keep working during the switch.

Release cadence reference
Monthly

Keep secrets out of channels and files

Client secrets and webhook URLs should never be pasted into chat, ticket comments or shared configuration files. Store them in a secret manager or a restricted file on the Mattermost host, and check that deployment repositories, Helm values and backup archives do not carry them in plain text. If a secret appears in a channel, treat it as exposed and rotate it rather than trying to delete the message.

Restrict who can edit subscriptions

Subscriptions decide which repository events reach which channel, so editing them is an access decision. Use Mattermost team and channel roles to limit who can add or change GitHub or GitLab subscriptions, and keep administrative setup with a small named group. Review the list of subscriptions against the people who currently hold those roles, and remove subscriptions whose owners have left the project.

Use HTTPS and certificate trust

A self-managed GitLab instance sends events and receives requests over the network, so its address should use HTTPS with a certificate that the Mattermost server trusts. Confirm the certificate chain with the infrastructure team, including any internal certificate authority, and test the connection from the Mattermost host rather than from a laptop. Do not disable certificate verification to get the integration working; fix the trust store instead.

Review channels receiving sensitive events

Merge requests, pipeline failures and security-related issues can reveal unreleased features, vulnerabilities and internal architecture. Decide which channels may receive code and security-sensitive events, and whether private channels or restricted teams are the right home for them. Check membership of those channels at a regular interval, because a channel that was public when the subscription was created may now include guests or external users.

Why GitHub or GitLab events stop reaching Mattermost

This table pairs each common failure with its likely cause, a first diagnostic check, and the fix. Work through the rows in order, since the network and certificate checks rule out the most causes quickly. Most silent failures trace back to a reachability problem, an unsubscribed event type, or a changed account or channel.

SymptomLikely causeFirst diagnostic checkFix
Webhook never firesMattermost URL is unreachable from the GitHub or GitLab networkFrom the source system's network, request the Mattermost webhook URL and confirm a responseOpen the path through proxies and firewalls, or use an address the source network can reach
Self-managed GitLab cannot connectCertificate authority for the Mattermost server is not trusted by GitLabCheck GitLab's recent outbound request errors and test TLS from the GitLab host with the same certificate chainInstall the internal certificate authority on the GitLab host and retest the connection
OAuth sign-in failsRedirect URI in the OAuth app does not match the Mattermost callback URLCompare the callback URL shown in Mattermost with the value saved in the GitHub or GitLab OAuth app, character by characterCorrect the redirect URI in the OAuth app, then reauthorize the integration
Some events arrive, others do notEvent type was not selected in the webhook or the channel subscriptionReview the selected events in the source webhook and the Mattermost integration settings for the target channelEnable the missing event types and send a test event for each one
Messages stop in one channelTarget channel was removed, renamed, or archivedConfirm the channel still exists under the same name and is not archivedRecreate or reconnect the integration to the current channel, then update the webhook if needed
Integration stops after staff changesThe user who authorized the app no longer has access to the repository, group, or channelCheck whether the authorizing user is still active and still a member of the source project and channelReauthorize with an account that has the required access, and document the owner
Setup wizard does not finishOAuth app or webhook was only partly created, or the browser session expired mid-flowCheck the GitHub or GitLab OAuth app and webhook list for duplicate or incomplete entriesRemove partial entries, then rerun the wizard, or configure the steps manually as the Mattermost docs describe

Questions teams ask before connecting GitHub or GitLab to Mattermost

Can our team connect GitHub or GitLab to Mattermost without outside help?

Yes, a team with administrator access to both Mattermost and the source platform can usually do the basic setup alone. Mattermost offers a /github setup wizard that walks through creating the GitHub OAuth app and webhook, and the GitLab integration documents the same kind of steps for SaaS and on-premises GitLab. The work that needs the most attention is deciding which repositories and projects feed which channels, confirming who may create the OAuth apps, and checking that the Mattermost server can reach the GitLab instance. Your team should confirm those points against the Mattermost GitHub integration docs and the GitLab integration docs before deciding whether to build it in-house.

What drives the effort of a GitHub or GitLab integration?

Effort grows with the number of repositories and projects, the number of channels they post into, and how much of the network path you must open. The main drivers are:

  • How many repositories or projects send events, and whether each needs its own subscription.
  • Self-managed GitLab networking, including whether the Mattermost server can reach the GitLab host and which firewall rules apply.
  • Certificates, especially an internal certificate authority that Mattermost and GitLab must both trust.
  • Channel design, meaning who reads each channel and how noisy merge request and pipeline events will be.

Ask any provider to split the quote along these lines so you can see which items are one-time and which need ongoing review.

Do GitHub and GitLab each need their own OAuth app?

Yes, each source platform needs its own OAuth application and webhook configuration because each one issues its own credentials and sends its own events. The GitHub integration creates a GitHub OAuth app and webhook, either through the setup wizard or by hand. The GitLab integration works from the GitLab side with its own application settings and supports both GitLab SaaS and on-premises GitLab. Keep the client secrets in a controlled place, record which account owns each app, and plan how the apps are rotated or removed when someone leaves the team.

Does our Mattermost plan level affect this integration?

The pricing page is the source to check, because the plan levels relevant to this integration are listed there and Mattermost does not publish prices. According to that page, SSO and AD/LDAP user sync start at the Professional plan, while high availability clustering and FIPS 140-3 compliance start at Enterprise, and air-gapped deployment is in Enterprise Advanced. Confirm with the Mattermost pricing page and your account contact whether the GitHub and GitLab integrations are available on your plan and whether they depend on SSO for user matching. Ask for that answer in writing before you buy.

What changes after a Mattermost or GitLab upgrade?

Upgrades can change webhook behavior, OAuth settings and the events each integration sends, so test them before they reach production channels. Mattermost ships server versions on the 16th of each month and publishes Extended Support Releases, and it lists support end dates for each version, so plan which track you are on. GitLab requires upgrades to pass through required upgrade stops, for example 18.2, 18.5, 18.8 and 18.11, so a source upgrade may need several steps. Keep a test instance, rerun the webhook and OAuth checks after each change, and confirm the current stops in the GitLab upgrade paths documentation before you schedule work.

Do we need an outside partner for this integration?

You need an outside partner when the work exceeds the time or skills your team can spare, or when the network, certificate and compliance requirements are unusual. A partner is useful if you run self-managed GitLab behind restricted networks, need the integration reviewed as part of an audit, or want the setup written up with runbooks. DeployOpen plans, implements, documents and supports self-hosted open-source platforms in infrastructure you control, and most engagements are fixed-scope with scope, deliverables and timelines agreed in writing before work starts. Ask any provider for a written scope that lists the repositories, channels, OAuth apps and verification steps covered.

Testing the integration and keeping it working after upgrades

Test the integration end to end before any real project depends on it. Create a sandbox repository on GitHub and a sandbox project on your GitLab instance, connect both to a test channel, and run five cases. Open a test pull request or merge request and confirm the event posts to the channel. Add an issue comment and a merge request comment to confirm comment events arrive. Trigger a pipeline in the sandbox project and confirm the result appears. Then revoke the OAuth token or app authorization and send another event, so you can see exactly what breaks and what the Mattermost channel shows when it does. Finally, point the webhook at a deliberately unreachable endpoint, or temporarily block it, and confirm that failures are visible to someone who will act on them. Record the results so the next retest has a baseline.

Ongoing operations depend on checks that are easy to skip. Review webhook delivery logs in GitHub and GitLab on a fixed schedule, since a failing webhook often produces no visible error in the channel. Plan re-authorization as part of offboarding: when a user who authorized the OAuth app leaves, confirm whether the integration still depends on that person's token and who will take over the subscription. Each Mattermost server upgrade should trigger a short retest of the same five cases, because the integration sits between three independently released systems. Mattermost publishes server binaries on the 16th of each month, and its Extended Support Releases follow a longer schedule, so confirm which track your server uses with the Mattermost server releases page before you schedule the retest. Also confirm, against your own GitLab version and the GitLab maintenance policy, that your self-managed instance is still on a supported release.

How GitHub and GitLab send events through Mattermost

The flow starts with a developer action in GitHub or a self-managed GitLab instance, which fires a webhook toward the self-hosted Mattermost server. Mattermost checks the event, then posts it into the target channel, storing the integration's state in its PostgreSQL database. The OAuth path runs in the other direction, when a user connects their account so Mattermost can read and act on that account. Check that each webhook and OAuth callback crosses the trust boundary only over the network paths your security team has approved, and confirm which source network can reach the Mattermost server.

Event and OAuth paths between the source network and the Mattermost network.

When a partner should scope the integration

A partner adds the most value when the integration touches more than one repository group, more than one GitLab instance, or a network that your own team cannot reach easily. A single GitHub organization with a few repositories and a Mattermost administrator who already knows the /github setup wizard can usually be handled in-house. The picture changes when a project portfolio spans several GitHub organizations or GitLab groups, when each group wants its own channel routing, or when the same Mattermost server must accept events from more than one source. In those cases the hard work is less the OAuth app and more the mapping: which projects post to which channels, who may change subscriptions, and how notifications stay correct as repositories are renamed or archived. Self-managed GitLab in an air-gapped or segmented network adds another layer. GitLab documents offline and air-gapped operation, and the webhook path from GitLab to Mattermost, along with any proxy or allow-listing between them, must be designed before anyone clicks a button. Confirm early whether your GitLab version and Mattermost version can reach each other on the network paths you plan to allow.

Compliance review is the other common trigger. Pull request titles, issue text, merge request comments and pipeline results can contain customer names, vulnerability details or unreleased product information, and each one becomes a message stored in Mattermost. A partner can help you list which event types leave the source system, which channels they reach, who can read those channels, and how retention and export settings in Mattermost apply to them. This review should happen before the first production webhook, not after an auditor asks where a finding was posted.

Before scoping, the client should confirm four things. First, access to the GitHub or GitLab administration side: organization owners or group owners who can create OAuth apps, register webhooks and approve the scope of access. Second, a Mattermost administrator with System Console access who can enable the integrations and plan the team and channel structure. Third, named channel owners who will approve which events their channels receive and who to contact when notifications become noisy. Fourth, a dedicated test project on each source system where webhooks can be created, fired and removed without touching production work. Ask the partner to confirm in writing which of these accounts and permissions they will need, and to state how credentials and webhook secrets will be stored and rotated.

How DeployOpen scopes and supports the GitHub and GitLab integration

DeployOpen plans and implements self-hosted Mattermost in your own infrastructure, including the GitHub or GitLab connection that posts pull request, merge request, issue and pipeline events into channels. Each engagement starts with a written scope that names the repositories, projects, channels and identity settings involved before any work begins.

How we scope

  • Confirm whether the source is GitHub, GitLab SaaS or a self-managed GitLab instance, and which Mattermost server you will connect it to.
  • List the repositories or GitLab projects, the event types each channel should receive, and who may change subscriptions.
  • Record who creates the OAuth app and webhook, and which accounts or service identities own them in your tenant.
  • Agree in writing the deliverables, acceptance tests and timeline before work starts. Engagements are fixed-scope.

How we build

  • Configure the GitHub integration through the /github setup wizard or manually, based on what your administrators allow.
  • Create the GitLab OAuth application and webhook for the chosen GitLab edition, and check that merge and comment events reach the right channel.
  • Test each event type with a non-production repository or project, including notifications for merges, issue comments and merge request comments.
  • Review the self-hosted server's network path from GitHub or GitLab to Mattermost, including proxies, certificates and outbound access rules.

How we hand over

  • Deliver a configuration record listing every OAuth app, webhook, channel mapping and the account that owns each one.
  • Document the steps to rotate OAuth secrets and webhook tokens, and to remove a repository or project from a channel.
  • Provide a test script and results showing which events were verified and which were out of scope.
  • Walk your administrators through the setup so they can add or change subscriptions without reopening the build.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer, scoped to the integration and the Mattermost server version in use.
  • Check the integration after each Mattermost server upgrade, since release timing follows the monthly schedule and ESR support windows.
  • Re-verify event delivery after GitHub or GitLab changes to their OAuth or webhook behavior, and after GitLab upgrade stops.
  • Confirm with your team which support scope, response expectations and recurring hours fit your environment before signing a retainer.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.