GitLab Webhook
Webhooks enable near-instant reactions to MR and pipeline events. Without webhooks, Auto Merge still works via 15-second polling.
- Generate a signing token:
echo "whsec_$(openssl rand -base64 32)" - Start Auto Merge with it in
GITLAB_WEBHOOK_SIGNING_TOKEN - Go to Settings > Webhooks in the GitLab project (GitLab 19.0 or newer)
- Set the URL:
https://<auto-merge-host>/api/auto-merge/events/from-gitlab - Enter the same value under Signing token
- Select triggers: Merge request events, Pipeline events
- Click Add webhook
GitLab signs every delivery with the token (HMAC-SHA256, Standard Webhooks). Auto Merge answers 401 to a delivery without a matching signature or with a webhook-timestamp more than 5 minutes off, and to every delivery while GITLAB_WEBHOOK_SIGNING_TOKEN is unset.
How It Works
Section titled “How It Works”When GitLab sends a webhook event, Auto Merge immediately triggers a processing run instead of waiting for the next poll cycle. Webhook-triggered runs are debounced to avoid redundant executions when multiple events arrive in quick succession.
Without Webhooks
Section titled “Without Webhooks”Auto Merge polls the GitLab API every 15 seconds. This works reliably but introduces a small delay between an MR state change and Auto Merge reacting to it. Webhooks reduce this delay to near-zero.