Skip to content

GitHub Commits

Track AI-attributed commits across your organization by detecting Co-Authored-By headers from Claude, Cursor, Copilot, and other AI tools.

Creating a GitHub App

  1. Go to GitHub → Your Organization → Settings → Developer settings → GitHub Apps → New GitHub App

  2. Configure basic info:

    • GitHub App name: Abacus Commit Tracker (must be unique across GitHub)
    • Homepage URL: Your Abacus deployment URL (e.g., https://abacus.yourcompany.com)
  3. Configure webhook:

    • Webhook URL: https://your-app.vercel.app/api/webhooks/github
    • Webhook secret: Generate with openssl rand -hex 32 and save it for later
  4. Set permissions (under “Permissions & events”):

    • Repository permissions:
      • Contents: Read-only (required to fetch commit history)
      • Metadata: Read-only (automatically granted)
    • Subscribe to events:
      • Check Push (this triggers the webhook)
  5. Configure installation access:

    • Where can this GitHub App be installed?: Select “Only on this account”
  6. Click Create GitHub App

  7. After creation, on the app settings page:

    • Note the App ID (shown near the top)
    • Scroll down and click Generate a private key (downloads a .pem file)
  8. Install the app on your organization:

    • Go to Install App in the left sidebar
    • Click Install next to your organization
    • Choose All repositories or select specific repos
    • Note the Installation ID from the URL: github.com/organizations/ORG/settings/installations/INSTALLATION_ID

Environment Variables

Terminal window
# GitHub App credentials (required for production)
GITHUB_APP_ID=123456
GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
GITHUB_APP_INSTALLATION_ID=12345678
GITHUB_WEBHOOK_SECRET=your-webhook-secret

Local Development Token

For local development, use a fine-grained personal access token instead of a GitHub App:

  1. Go to GitHub → Settings → Developer settings → Fine-grained tokens

  2. Generate new token with:

    • Repository access: Select specific repos or “All repositories”
    • Permissions: Contents (read-only)
  3. Set GITHUB_TOKEN in .env.local

Terminal window
# For local development only
GITHUB_TOKEN=github_pat_...

Sync Behavior

SettingValue
Real-timeWebhook receives push events instantly
BackfillCron job runs every 6 hours (90-day target)
DetectionIdentifies commits with AI attribution patterns

Detected Patterns

PatternTool
Co-Authored-By: Claude <*@anthropic.com>Claude Code
🤖 Generated with [Claude Code]Claude Code
Co-Authored-By: Codex <*>Codex
Co-Authored-By: GitHub Copilot <*>GitHub Copilot
Co-Authored-By: Copilot <*>GitHub Copilot
Author: copilot-swe-agent[bot]GitHub Copilot
Co-Authored-By: Cursor <*>Cursor
Co-Authored-By: Windsurf <*>Windsurf
Co-Authored-By: Codeium <*>Windsurf

Manual Sync

Test detection without database:

Terminal window
pnpm cli github:sync getsentry/sentry --dry-run

Check sync status:

Terminal window
pnpm cli github:status

Sync specific repo:

Terminal window
pnpm cli github:sync getsentry/sentry --days 30

Backfill all repos:

Terminal window
pnpm cli backfill github --from 2024-10-01