Endpoint
- Agent jobs complete (PR created)
- Jobs fail during execution
- PRs are merged
Authentication
Public endpoint - Authenticated via GitHub webhook secret. Does not requirex-api-key header. Instead, validates x-github-webhook-secret-token header against GH_WEBHOOK_SECRET environment variable.
Request Headers
GitHub webhook secret (configured in repository settings)
Request Body
GitHub sends webhook payloads with these fields:Extracted from payload or branch name (
job/{job_id})Branch name (used to extract
job_id if not provided)Original job task prompt
Pull request URL
GitHub Actions run URL
Job status:
completed, failed, mergedResult of auto-merge attempt
Job execution log (fetched from API if not in payload)
List of files modified by the job
Commit message from the job
Git commit SHA (used to fetch log if not in payload)
Response
Success (200)
Skipped (200)
If the webhook is not for a job branch:Unauthorized (401)
Error (500)
How It Works
- GitHub sends webhook event
- Server validates
GH_WEBHOOK_SECRET - Extracts
job_idfrom payload or branch name - Fetches job log if not included in payload
- Aggregates job results:
- Calls
summarizeJob(results)to generate AI summary - Creates notification via
createNotification(message, payload) - Returns success response
Job ID Extraction
Extracts job ID from branch names likejob/abc12345:
Environment Variables
Secret token configured in GitHub repository webhook settings
GitHub Webhook Setup
- Go to your repository settings
- Navigate to Webhooks > Add webhook
- Set Payload URL:
https://your-domain.com/api/github/webhook - Set Content type:
application/json - Set Secret: Your
GH_WEBHOOK_SECRETvalue - Select events:
- Pull requests (for job PR creation)
- Workflow runs (for job completion/failure)
- Save webhook
Notification System
Webhook events create database notifications viewable in the UI:- AI-generated summary of job results
- Links to PR and workflow run
- Status (completed/failed/merged)
- Changed files
- Execution log