Skip to main content

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

  1. Go to GitHub Settings > Developer settings > Personal access tokens
  2. Click Generate new token (classic)
  3. Select scopes:
    • repo - Full repository access
    • write:discussion - Post comments
    • workflow - Access GitHub Actions
  4. Copy the generated token
Use a service account rather than personal account for production.

Step 2: Configure Webhook

  1. Go to your repository Settings > Webhooks
  2. Click Add webhook
  3. Configure:
    • Payload URL: https://api.incidentfox.ai/api/github/webhook
    • Content type: application/json
    • Secret: Generate a random string
  4. Select events:
    • Issue comments
    • Pull request review comments
    • Check runs (for CI/CD monitoring)
  5. Save

Step 3: Add to IncidentFox

Via Web UI:
  1. Go to Team Console > Integrations
  2. Click Add Integration > GitHub
  3. Enter:
    • Personal Access Token
    • Webhook Secret
    • Default Organization
    • Default Repository
  4. Click Test Connection
  5. Save
Via Configuration:

Usage

Trigger Investigation from PR

Comment on a Pull Request:

Trigger from Issue

Comment on an Issue:

Auto-Fix CI Failures

When a PR has failing checks:
IncidentFox will:
  1. Analyze the CI logs
  2. Identify the root cause
  3. Propose a fix
  4. Wait for approval before committing

CI/CD Monitoring

Automatic Investigation

Configure IncidentFox to automatically investigate CI failures:

Supported CI Systems

Auto-Fix Workflow

When IncidentFox identifies a fix:
1

Detection

CI failure detected via webhook
2

Analysis

Agent analyzes logs and code changes
3

Root Cause

Identifies the specific breaking change
4

Proposal

Posts proposed fix as a comment
5

Approval

Waits for user to type fix to approve
6

Commit

Pushes fix commit to the PR branch

Example Fix Flow

User comment:
IncidentFox response:
User response:
IncidentFox:

Tools Available

search_github_code

Search code across repositories.

read_github_file

Read specific file contents.

create_pull_request

Create PRs (with approval).

list_pull_requests

List PRs in a repository.

get_github_actions_logs

Fetch CI/CD logs.

Best Practices

Start with read-only access and enable write operations only when comfortable with the auto-fix capabilities.
  1. Use specific repos - Don’t enable for all repos initially
  2. Review fixes before applying - Always verify proposed changes
  3. Set up notifications - Route CI failures to appropriate channels
  4. 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

  1. Check webhook URL is correct
  2. Verify secret matches configuration
  3. Check GitHub webhook delivery logs
  4. Ensure network allows outbound to IncidentFox

Bot Not Commenting

  1. Verify PAT has repo scope
  2. Check bot has write access to repo
  3. Review webhook events enabled

Next Steps

PagerDuty

Auto-investigate alerts

Tools Catalog

See all GitHub tools