GitHub Webhooks
Set up GitHub webhooks to trigger Sluice pipelines.
GitHub Webhooks
This guide walks you through setting up GitHub webhooks to automatically trigger your Sluice pipelines.
Prerequisites
- A Sluice pipeline configured and ready
- Admin access to your GitHub repository
- Your pipeline’s webhook URL and secret
Step 1: Get Webhook Details
- Navigate to your pipeline in Sluice
- Go to Settings > Webhooks
- Copy the Webhook URL
- Copy the Webhook Secret
Step 2: Configure GitHub
- Go to your GitHub repository
- Click Settings > Webhooks
- Click Add webhook
Fill in the form:
| Field | Value |
|---|---|
| Payload URL | Your Sluice webhook URL |
| Content type | application/json |
| Secret | Your Sluice webhook secret |
Step 3: Select Events
Choose which events trigger the webhook:
Recommended: Just the push event
For most CI/CD pipelines, select Just the push event.
Individual events
For more control, select Let me select individual events:
- Pushes - Trigger on code push
- Pull requests - Trigger on PR activity
- Releases - Trigger on release published
- Branch or tag creation - Trigger on new branch/tag
Note
Start with push events only. Add more events as needed.
Step 4: Activate
- Ensure Active is checked
- Click Add webhook
- GitHub will send a ping event to verify
Verify Setup
After adding the webhook:
- Go to the webhook you just created
- Click on the Recent Deliveries tab
- Look for a successful
pingdelivery (green checkmark)
If the ping failed:
- Check the Response tab for error details
- Verify the webhook URL is correct
- Ensure the secret matches
Test with a Push
Make a test commit:
git commit --allow-empty -m "Test webhook"
git push Then verify:
- Check GitHub’s Recent Deliveries for a successful delivery
- Check Sluice for a new pipeline run
- Verify the run shows the correct commit info
Event Payloads
Push Event
When code is pushed, GitHub sends:
{
"ref": "refs/heads/main",
"before": "abc123...",
"after": "def456...",
"repository": {
"full_name": "org/repo",
"clone_url": "https://github.com/org/repo.git"
},
"pusher": {
"name": "username",
"email": "[email protected]"
},
"commits": [...]
} Pull Request Event
When PR activity occurs:
{
"action": "opened",
"number": 42,
"pull_request": {
"title": "Add feature",
"head": {
"ref": "feature-branch",
"sha": "abc123..."
},
"base": {
"ref": "main"
}
}
} Branch Protection
For protected branches, you might want to require status checks:
- Go to Settings > Branches
- Click Add rule or edit existing
- Enable Require status checks to pass
- Search for and select Sluice checks
Warning
Status checks require the Sluice GitHub App. Contact support for setup.
Troubleshooting
Webhook not triggering
- Check if the webhook is Active in GitHub settings
- Verify Recent Deliveries shows the event
- Check the response status and body
Signature validation failed
- Regenerate the secret in Sluice
- Update the secret in GitHub
- Redeliver a recent event to test
Wrong branch triggering
Configure branch filters in your Sluice pipeline settings to control which branches trigger runs.
GitHub Enterprise
For GitHub Enterprise Server:
- Use your enterprise instance URL for repository cloning
- Configure firewall rules to allow outbound webhooks to Sluice
- Ensure SSL certificates are valid
Next Steps
- Webhook Overview - General webhook concepts
- Pipeline Configuration - Configure your pipeline