Overview
The GitHub integration enables IncidentFox to:
- Analyze CI/CD failures automatically
- Investigate code-related issues
- Correlate deployments with incidents
- Propose fixes for failing tests
Prerequisites
- GitHub repository admin access
- IncidentFox account with GitHub integration enabled
- GitHub Personal Access Token (PAT)
Setup
Step 1: Generate GitHub Token
- Go to GitHub Settings > Developer settings > Personal access tokens
- Click Generate new token (classic)
- Select scopes:
repo - Full repository access
write:discussion - Post comments
workflow - Access GitHub Actions
- Copy the generated token
Use a service account rather than personal account for production.
- Go to your repository Settings > Webhooks
- Click Add webhook
- Configure:
- Payload URL:
https://api.incidentfox.ai/api/github/webhook
- Content type:
application/json
- Secret: Generate a random string
- Select events:
- Issue comments
- Pull request review comments
- Check runs (for CI/CD monitoring)
- Save
Step 3: Add to IncidentFox
Via Web UI:
- Go to Team Console > Integrations
- Click Add Integration > GitHub
- Enter:
- Personal Access Token
- Webhook Secret
- Default Organization
- Default Repository
- Click Test Connection
- Save
Via Configuration:
{
"tools": {
"github": {
"enabled": true,
"token": "vault://secrets/github-token",
"webhook_secret": "vault://secrets/github-webhook-secret",
"default_org": "acme-corp",
"default_repo": "main-app"
}
}
}
Usage
Trigger Investigation from PR
Comment on a Pull Request:
@incidentfox investigate why this test is failing
Trigger from Issue
Comment on an Issue:
@incidentfox analyze the authentication changes in this PR
Auto-Fix CI Failures
When a PR has failing checks:
@incidentfox fix the failing tests
IncidentFox will:
- Analyze the CI logs
- Identify the root cause
- Propose a fix
- Wait for approval before committing
CI/CD Monitoring
Automatic Investigation
Configure IncidentFox to automatically investigate CI failures:
{
"github": {
"auto_investigate_ci_failures": true,
"auto_investigate_repos": ["main-app", "api-service"],
"ci_failure_notification_channel": "#ci-failures"
}
}
Supported CI Systems
| System | Status | Capabilities |
|---|
| GitHub Actions | Full | Logs, status, artifacts |
| AWS CodePipeline | Full | Pipeline status, logs |
| Jenkins | Basic | Build status via webhooks |
| CircleCI | Basic | Status via webhooks |
Auto-Fix Workflow
When IncidentFox identifies a fix:
Detection
CI failure detected via webhook
Analysis
Agent analyzes logs and code changes
Root Cause
Identifies the specific breaking change
Proposal
Posts proposed fix as a comment
Approval
Waits for user to type fix to approve
Commit
Pushes fix commit to the PR branch
Example Fix Flow
User comment:
@incidentfox why is this PR failing?
IncidentFox response:
Investigation Complete
The Cypress test is failing because the API endpoint changed:
- Test expects: /api/data
- Backend returns: /api/records
Root Cause: Line 42 in src/api/index.js changed the endpoint path.
Proposed Fix:
- Update test file to use new endpoint path
Type `fix` to apply this change automatically.
User response:
IncidentFox:
Fix applied! Created commit abc123.
Waiting for CI to complete...
✅ All checks passed!
search_github_code
Search code across repositories.
@incidentfox search for payment processing logic in the codebase
read_github_file
Read specific file contents.
@incidentfox show me the contents of src/config/database.js
create_pull_request
Create PRs (with approval).
@incidentfox create a PR with the fix
list_pull_requests
List PRs in a repository.
@incidentfox show recent PRs for the api-service repo
get_github_actions_logs
Fetch CI/CD logs.
@incidentfox get the logs from the failing GitHub Actions run
Best Practices
Start with read-only access and enable write operations only when comfortable with the auto-fix capabilities.
- Use specific repos - Don’t enable for all repos initially
- Review fixes before applying - Always verify proposed changes
- Set up notifications - Route CI failures to appropriate channels
- Use branch protection - Require review before merging auto-fixes
Security Considerations
- Use fine-grained PATs when possible
- Store tokens in secrets manager
- Limit repository access scope
- Enable audit logging for all actions
- Require approval for write operations
Troubleshooting
Webhook Not Receiving
- Check webhook URL is correct
- Verify secret matches configuration
- Check GitHub webhook delivery logs
- Ensure network allows outbound to IncidentFox
- Verify PAT has
repo scope
- Check bot has write access to repo
- Review webhook events enabled
Next Steps