Overview
The webhook endpoint receives and processes GitHub webhook events. It returns an immediate 200 OK response after validation and processes webhooks asynchronously in the background to prevent GitHub webhook timeouts.Endpoint
Request Headers
GitHub event type (e.g.,
pull_request, push, issue_comment, check_run, pull_request_review)Unique delivery ID for tracking webhook processing in logs
HMAC-SHA256 signature for webhook payload verification (required if
webhook-secret is configured)Request Body
The request body contains the GitHub webhook payload as JSON. The exact structure depends on the event type.Action that triggered the webhook (event-specific, e.g.,
opened, synchronize, closed)User who triggered the webhook event
Response
HTTP status code (200 for successful validation)
Status message indicating webhook was queued for processing
GitHub delivery ID for tracking this webhook in logs
GitHub event type that was received
Background Processing
Critical Design Pattern: This endpoint returns 200 OK immediately after validation to prevent GitHub webhook timeouts (10 second limit). All processing happens asynchronously in the background.Synchronous Validation (must pass to return 200)
- Read request body
- Verify signature (if
webhook-secretconfigured) - Parse JSON payload
- Validate required fields:
repository.name,repository.full_name,X-GitHub-Eventheader
Background Processing (errors logged only)
- Configuration loading and repository validation
- GitHub API calls and webhook processing
- All handler execution (PR management, checks, notifications)
- All errors are caught and logged (check logs with
delivery_idto verify results)
delivery_id to verify actual processing results.
Security
Signature Verification
Whenwebhook-secret is configured, the server validates the X-Hub-Signature-256 header using HMAC-SHA256:
IP Allowlist
Optionally restrict webhook requests to GitHub and/or Cloudflare IP ranges:Supported Events
The webhook server processes these GitHub event types:pull_request- Pull request opened, synchronized, closed, etc.pull_request_review- PR review submitted, edited, dismissedissue_comment- Comments on PRs and issues (handles user commands)push- Commits pushed to repositorycheck_run- Check run created, completed, rerequested
Status Codes
Webhook payload validated and queued for background processing
- Missing required header:
X-GitHub-Event - Failed to read request body
- Invalid JSON payload
- Missing required payload fields:
repository,repository.name,repository.full_name - Invalid client IP address (when IP verification enabled)
- Missing
X-Hub-Signature-256header (when webhook secret configured) - Signature verification failed (invalid HMAC signature)
- Client IP not in allowlist (when IP verification enabled)
- Configuration error during signature verification setup
Examples
Basic webhook request
Webhook request with signature verification
Error Responses
Missing X-GitHub-Event header
Invalid JSON payload
Missing repository in payload
Signature verification failed
IP not in allowlist
Webhook Processing Flow
Monitoring
Use thedelivery_id from the response to track webhook processing in logs:
Related Endpoints
- GET /webhook_server/healthcheck - Server health check
- Log Viewer API - Query webhook processing logs