Webhooks Overview
Set up webhooks to automatically trigger pipelines from Git events.
Webhooks
Webhooks enable automatic pipeline triggers when events occur in your Git repository.
How It Works
- You configure a webhook in your Git provider (GitHub, GitLab, etc.)
- When an event occurs (push, PR, etc.), your Git provider sends a POST request to Sluice
- Sluice validates the request signature
- If valid, Sluice triggers the appropriate pipeline
- The pipeline runs with Git context (branch, commit, etc.)
Getting Your Webhook URL
Each pipeline has a unique webhook URL:
- Navigate to your pipeline in the dashboard
- Go to the Settings tab
- Find the Webhooks section
- Copy the Webhook URL
The URL format is:
https://api.sluice.dev/webhooks/pipelines/{pipeline_id} Webhook Secret
For security, webhooks should be signed. Sluice provides a secret for each pipeline:
- In the Webhooks section, find the Secret
- Click Show or Copy to get the secret
- Configure this secret in your Git provider
Warning
Supported Events
| Event Type | Description | Trigger |
|---|---|---|
push | Code pushed to branch | Commit pushed |
pull_request | PR opened, updated, merged | PR activity |
tag | Tag created | New tag pushed |
release | Release published | GitHub release |
Event Filtering
Configure which events trigger your pipeline:
webhooks:
events:
- push
- pull_request
branches:
include:
- main
- develop
- 'feature/*'
exclude:
- 'dependabot/*' Branch Patterns
Use glob patterns to match branches:
| Pattern | Matches |
|---|---|
main | Only main |
feature/* | feature/login, feature/api |
release/** | release/v1, release/2024/jan |
* | Any branch |
Git Context
When triggered by webhook, these variables are available:
| Variable | Description |
|---|---|
GIT_BRANCH | Branch name |
GIT_COMMIT | Full commit SHA |
GIT_COMMIT_SHORT | Short commit SHA |
GIT_AUTHOR | Commit author email |
GIT_MESSAGE | Commit message |
GIT_REPO | Repository URL |
WEBHOOK_EVENT | Event type (push, pull_request) |
For pull requests:
| Variable | Description |
|---|---|
PR_NUMBER | Pull request number |
PR_TITLE | Pull request title |
PR_SOURCE_BRANCH | Source branch |
PR_TARGET_BRANCH | Target branch |
Security
Signature Verification
Sluice verifies all incoming webhooks using the configured secret:
- GitHub:
X-Hub-Signature-256header with HMAC-SHA256 - GitLab:
X-Gitlab-Tokenheader with secret token
Requests with invalid or missing signatures are rejected.
IP Allowlisting
For additional security, you can restrict webhooks to specific IP ranges:
webhooks:
allowedIPs:
- 140.82.112.0/20 # GitHub
- 192.30.252.0/22 # GitHub Note
Retry Behavior
If webhook processing fails, Sluice does not retry automatically. Check your Git provider’s webhook delivery logs for:
- Response status codes
- Response body (error messages)
- Delivery timing
Testing Webhooks
Manual Test
Most Git providers let you redeliver webhooks:
- Go to your repository settings
- Find the webhook configuration
- View recent deliveries
- Click “Redeliver” on any event
Local Testing
For local development, use a tunnel service:
# Using ngrok
ngrok http 8080
# Configure the ngrok URL as your webhook endpoint Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| Webhook not triggering | Wrong URL | Verify the webhook URL |
| Signature invalid | Wrong secret | Reconfigure the secret |
| Branch not matching | Filter config | Check branch patterns |
| 500 error | Server error | Check Sluice status page |
Next Steps
- GitHub Setup - Configure GitHub webhooks
- GitLab Setup - Configure GitLab webhooks