GitLab Integration
Set up HookWatch to receive GitLab webhooks for repository events like pushes, merge requests, pipelines, and releases.
Prerequisites
- A HookWatch account
- A GitLab project with Maintainer access or higher
- A server endpoint to process webhook payloads
Step 1: Create a HookWatch endpoint
- Go to your Endpoints page
- Click "Create Endpoint"
- Enter a name like "GitLab Webhooks"
- Enter your destination URL (where you want webhooks forwarded)
- Copy the generated webhook URL
Your HookWatch URL will look like:
https://hook.hookwatch.dev/wh/abc123xyzStep 2: Configure GitLab webhooks
For a project:
- Go to your project on GitLab
- Click Settings > Webhooks
- Paste your HookWatch URL in the "URL" field
- Enter a Secret token (used to verify webhooks)
- Select the trigger events you want
- Click "Add webhook"
For a group:
- Go to your group settings on GitLab
- Click Webhooks in the sidebar
- Follow the same steps as above
Common trigger events:
Push eventsMerge request eventsPipeline eventsTag push eventsIssue eventsRelease eventsDeployment eventsNote (comment) eventsStep 3: Verify webhooks on your server
GitLab sends a secret token in the X-Gitlab-Token header. HookWatch forwards this header so you can verify the webhook by comparing it to your stored
secret.
Note
Unlike GitHub and Stripe which use HMAC signatures, GitLab uses a simple secret token comparison. The token is sent as a plain header value.
GitLab webhook headers
HookWatch forwards all GitLab headers. Here are the important ones:
| Header | Description |
|---|---|
X-Gitlab-Event | The event type (Push Hook, Merge Request Hook, etc.) |
X-Gitlab-Token | Secret token for verification |
X-Gitlab-Event-UUID | Unique ID for the webhook delivery |
X-Gitlab-Instance | The GitLab instance URL |
Testing the integration
You can test GitLab webhooks by:
- Go to your webhook settings and click "Test" next to any event type
- Push a commit or create a merge request
- Check your HookWatch Events page to see the events
Common issues
Token verification fails
Ensure the secret token in your code exactly matches what you entered in GitLab settings. The token is case-sensitive.
Webhook shows SSL error
If using self-hosted GitLab, make sure "Enable SSL verification" is checked. HookWatch endpoints always support SSL.
Missing pipeline events
Pipeline events are only sent for pipelines triggered by pushes, merge requests, or API calls. Scheduled pipelines may need a separate webhook configuration.