GitHub Integration Guide
Send repository events through webhooks.
Configure GitHub repository webhooks to send event notifications to Harness AI SRE for deployments, releases, and security alerts.
Before you begin
Harness webhook endpoint: Create a GitHub webhook in Harness AI SRE using the GitHub webhook template.
GitHub permissions: Admin access to the repository or organization.
Webhook URL: Copy the webhook URL from your Harness webhook configuration.
GitHub webhooks documentation: Go to Webhooks Documentation to understand webhook configuration and event types.
Event payloads reference: Go to Webhook Events and Payloads for event-specific payload structures.
Create repository webhook
Navigate to webhook settings
Go to your GitHub repository
Click Settings, then click Webhooks
Click Add webhook
Go to your GitHub organization
Click Settings, then click Webhooks
Click Add webhook
Organization webhooks receive events from all repositories in the organization.
Configure webhook
Payload URL: Your Harness webhook URL
https://<your-harness-instance>/gateway/ai-sre/api/webhooks/<webhook-id>Content type:
application/jsonSecret: (Optional) Webhook secret for signature verification
SSL verification: Enable SSL verification
Which events: Select events to trigger webhook
Payload URL: Your Harness webhook URL
Content type:
application/jsonSecret: Enter a secure secret
GitHub signs payloads with HMAC-SHA256
Harness can verify the
X-Hub-Signature-256header
SSL verification: Enable SSL verification
Which events: Select events
Note: Store the secret securely and configure it in your Harness webhook validation settings.
Payload URL: Your Harness webhook URL
Content type:
application/jsonWhich events: Select Let me select individual events
Common events for monitoring:
☑ Deployments
☑ Deployment statuses
☑ Releases
☑ Pull requests
☑ Pull request reviews
☑ Issues
☑ Issue comments
☑ Security and analysis (code scanning alerts, secret scanning alerts)
☑ Workflow runs
Activate webhook
Enable the webhook so GitHub begins sending events:
Check Active to enable the webhook
Click Add webhook
Select events to monitor
Deployment events
Monitor deployment activities:
Events:
Deployments: Deployment created
Deployment statuses: Deployment status changed (pending, success, failure, error)
Use cases:
Track deployment failures
Alert on production deployments
Monitor deployment rollbacks
Release events
Monitor software releases:
Events:
Releases: Release published, created, edited, deleted
Use cases:
Notify on new releases
Track release cadence
Monitor hotfix releases
Pull request events
Monitor code changes:
Events:
Pull requests: Opened, closed, merged, reopened
Pull request reviews: Submitted, edited, dismissed
Pull request review comments: Created, edited, deleted
Use cases:
Track deployment-related PRs
Monitor high-impact changes
Alert on emergency merges
Security events
Monitor security findings:
Events:
Code scanning alerts: Created, fixed, dismissed, reopened
Secret scanning alerts: Created, resolved, reopened
Dependabot alerts: Created, dismissed, fixed, reintroduced
Use cases:
Alert on critical security vulnerabilities
Track secret leaks
Monitor dependency vulnerabilities
Configure field mapping in Harness
In your Harness webhook configuration, map GitHub payload fields to alert properties.
GitHub webhook payload structure
Payload varies by event type. Common structure:
Field mapping by event type
Basic mapping:
CEL mapping:
Basic mapping:
CEL mapping:
Basic mapping:
CEL mapping:
Test the integration
Test with webhook delivery
Redeliver a past webhook payload to test the integration:
Go to Settings, then click Webhooks in your repository
Click your webhook
Select the Recent Deliveries tab
Click Redeliver on any past delivery to test
Trigger real events
Create a test deployment using GitHub API:
Create a test release:
Go to Releases in your repository
Click Draft a new release
Enter tag version (e.g.,
v0.0.1-test)Enter release title and notes
Check This is a pre-release
Click Publish release
Verify in Harness
Confirm the event arrived and mapped correctly:
Navigate to Alerts in Harness AI SRE
Check that the event appears
Verify field mapping is correct
Available GitHub webhook headers
GitHub sends these headers with all webhooks:
X-GitHub-Event
Event type
deployment_status, release, code_scanning_alert
X-GitHub-Delivery
Unique delivery ID
12345678-1234-1234-1234-123456789012
X-Hub-Signature-256
HMAC-SHA256 signature
sha256=... (if secret configured)
X-GitHub-Hook-ID
Webhook configuration ID
123456
X-GitHub-Hook-Installation-Target-ID
Installation/org ID
456789
X-GitHub-Hook-Installation-Target-Type
Target type
repository, organization
Advanced configuration
Filter by environment
Only process production deployments:
Filter by branch
Only process events from main branch:
Route by repository
Create separate webhooks for different repositories or use routing:
Security alert prioritization
Prioritize critical security alerts:
Troubleshooting
Example: complete integration
GitHub webhook configuration
The following example shows an end-to-end GitHub webhook setup and its field mapping.
Payload URL:
https://app.harness.io/gateway/ai-sre/api/webhooks/wh_abc123Content type:
application/jsonSecret:
your-secure-secretEvents:
Deployment statuses
Releases
Code scanning alerts
Active: ✓
Harness webhook field mapping example
Next steps
Route alerts: Route and deduplicate GitHub events.
Use CEL in webhooks: Add advanced event filtering.
AI agent: Enable automated incident investigation.
GitHub template: Use the pre-configured template.
Related documentation
GitHub official documentation
Webhooks documentation: Complete guide to GitHub webhooks configuration and event types.
Webhook events and payloads: Event-specific payload structures (
deployment_status,release,code_scanning_alert).Validating webhook deliveries: Signature validation (
X-Hub-Signature-256) and secret configuration.Deployments API: Deployment and deployment status payload structures.
Last updated
Was this helpful?