For the complete documentation index, see llms.txt. This page is also available as Markdown.

GitLab Integration Guide

Send repository and pipeline events through webhooks.

Configure GitLab project or group webhooks to send event notifications to Harness AI SRE for deployments, pipelines, and security alerts.

Before you begin

  • Harness webhook endpoint: Create a GitLab webhook in Harness AI SRE using the GitLab webhook template.

  • GitLab permissions: Maintainer or Owner role for the project/group.

  • Webhook URL: Copy the webhook URL from your Harness webhook configuration.

  • GitLab webhooks documentation: Go to Webhooks for webhook configuration guide.

  • Webhook events reference: Go to Webhook Events for event-specific payload structures.


Create project webhook

  1. Go to your GitLab project

  2. Click Settings, then click Webhooks

  3. Expand Add new webhook

  1. Go to your GitLab group

  2. Click Settings, then click Webhooks

  3. Click Add new webhook

Group webhooks receive events from all projects in the group.

Configure webhook

  • URL: Your Harness webhook URL

    https://<your-harness-instance>/gateway/ai-sre/api/webhooks/<webhook-id>
  • Secret token: (Optional) Sent as plain text for token comparison, not cryptographic signature verification

  • Trigger: Select events to trigger webhook

  • SSL verification: Enable SSL verification

  • URL: Your Harness webhook URL

  • Secret token: Enter a secure token

    • GitLab sends this in X-Gitlab-Token header

    • Harness can verify this header

  • Trigger: Select events

  • SSL verification: Enable

  • URL: Your Harness webhook URL

  • Trigger: Select specific events

Common events for monitoring:

  • ☑ Push events

  • ☑ Tag push events

  • ☑ Merge request events

  • ☑ Pipeline events

  • ☑ Deployment events

  • ☑ Releases events

  • ☐ Issues events (optional)

  • ☐ Confidential issues events

  • ☐ Merge request approval events

  • ☐ Job events (optional)

Test webhook

Click Test, select the event type, then click the Test button.

GitLab sends a test payload to verify the webhook is reachable.

Add webhook

Click Add webhook to save.


Configure field mapping in Harness

GitLab webhook payload structure

Field mapping by event type


Available GitLab webhook headers

Header
Description
Example

X-Gitlab-Event

Event type

Pipeline Hook, Deployment Hook, Release Hook

X-Gitlab-Token

Secret token, sent as plain text (if configured)

(if configured)

X-Gitlab-Instance

GitLab instance URL

https://gitlab.com

webhook-signature

HMAC-SHA256 signature (if a signing token is configured)

v1,<base64_signature>

webhook-id

Unique message ID used in signature computation

msg_2wF...

webhook-timestamp

Unix timestamp used in signature computation

1717000000


Next steps


GitLab official documentation

  • Webhooks: Complete guide to GitLab webhook configuration and setup.

  • Webhook events: Event-specific payload structures (pipeline, deployment, release).

  • Pipeline events: Pipeline webhook payload structure and build details.

  • Deployment events: Deployment webhook payload and environment information.

Last updated

Was this helpful?