Skip to main content

GitLab Integration

Dispatch provides a first-class GitLab integration that automatically creates webhook endpoints for your projects.

Connecting GitLab​

  1. Navigate to your project's Sources page
  2. Click Connect GitLab
  3. Authorize the Dispatch GitLab OAuth app
  4. Select a GitLab project
  5. Choose which events to receive (see Event Selection below)

Dispatch will:

  • Create a webhook endpoint with provider = "gitlab"
  • Register a webhook on the selected GitLab project pointing to your Dispatch endpoint
  • Configure the endpoint to receive the selected event types

Event Selection​

When connecting a GitLab project, choose one of three modes:

ModeDescription
Push onlyReceive only push (commit) events.
All eventsReceive every event type GitLab supports for the project.
CustomPick specific event types from the full list of supported GitLab hooks.

Supported GitLab Events​

GitLab sends the event type in the X-Gitlab-Event header. Dispatch auto-formats the following event types:

EventDescription
Push HookCommits pushed to a branch
Merge Request HookMR opened, closed, merged, approved
Issue HookIssue opened, closed, updated
Note HookComment on an issue, MR, commit, or snippet
Tag Push HookTag created or deleted
Pipeline HookPipeline created or status changed
Job HookJob status change
Release HookRelease created or updated
Deployment HookDeployment created or updated
Member HookProject member added or removed
Confidential Issue HookConfidential issue events

Signature Verification​

GitLab webhooks include an X-Gitlab-Token header containing a secret token. Dispatch performs a literal match of this header against the endpoint's signing secret. When you connect GitLab via OAuth, Dispatch automatically sets the signing secret on the GitLab webhook. To rotate it later, click Regenerate Secret in Edit Source: Dispatch updates the GitLab webhook for you, and the old secret keeps working for a while so deliveries keep verifying while the provider switches (see Signing secrets on integration sources).

If configuring manually, set the same value in both:

  • The GitLab webhook Secret Token field
  • The Dispatch endpoint's Signing Secret

Auto-Formatted Embeds​

When no custom template is assigned, Dispatch auto-detects GitLab payloads and generates specialized embeds:

Push Hook​

  • Shows branch name, commit count, and commit messages
  • Links to the compare view
  • Color-coded by branch

Merge Request Hook​

  • Shows MR title, description, and status
  • Includes source/target branch info
  • Color-coded by action (green for opened, purple for merged, red for closed)

Issue Hook​

  • Shows issue title, description, and labels
  • Includes assignee information
  • Color-coded by action

Disconnecting​

To disconnect a GitLab project:

  1. Go to Sources and find the GitLab source
  2. Click the unplug icon on the source, then click Disconnect to confirm
  3. Dispatch tries to remove the webhook from GitLab, then deletes the source (a source that still has stored events is archived instead, keeping them). If the webhook can't be removed (for example, because the GitLab connection was revoked), the source is still removed, and you delete the webhook yourself in GitLab under the project's Settings → Webhooks

To remove your GitLab account from the project, click Add Source, choose GitLab, click Disconnect next to your account, and confirm. This only removes the connection: your GitLab sources aren't deleted, and their webhooks stay in GitLab. Disconnect the projects you no longer want first, since Dispatch needs a GitLab connection to remove their webhooks.