GitHub App Setup
Install the AFA Gate Check GitHub App for automated PR analysis.
GitHub App Setup
The AFA Gate Check GitHub App analyzes pull requests automatically and posts results as a Check Run.
Install
- Visit github.com/apps/afa-gate-check
- Click Install
- Select the repositories you want AFA to analyze
- Done -- AFA starts analyzing PRs immediately
What happens on a PR
When you open or update a pull request:
- GitHub sends a webhook to AFA
- AFA fetches the PR diff (paginated, up to 3 pages)
- Each changed function is parsed and analyzed by four agents (security, performance, maintainability, documentation)
- Results are posted as a Check Run on the PR
- A summary comment is added with findings and scores
The GitHub App runs analysis only -- it does not generate enhancements or modify your code. This is the free funnel: analysis costs no LLM tokens for enhancement generation.
Configuration
Add a .afa.yaml to your repository root to customize analysis behavior:
version: "1.0"
model:
provider: gemini
model: gemini-3-flash-preview
analysis:
languages:
- python
- typescript
exclude:
- "tests/**"
- "vendor/**"
- "migrations/**"Without a config file, AFA uses sensible defaults (Anthropic provider, Python + TypeScript, standard exclusions).
Billing
The GitHub App is available on all tiers including Community (free). Analysis usage counts against your monthly quota:
| Tier | Monthly analyses | Rate limit |
|---|---|---|
| Community | 200 | 15/min |
| Developer | 2,000 | 30/min |
| Team | 10,000 | 100/min |
| Enterprise | 50,000 | 500/min |
When you exceed your quota, AFA posts a comment with an upgrade link instead of analysis results.
Self-hosted
If you're running AFA on your own infrastructure, set up webhook forwarding:
# Terminal 1: Forward webhooks from smee.io to localhost
npx smee-client -u https://smee.io/<channel-id> -t http://localhost:3000/webhook
# Terminal 2: Start the webhook receiver
uvicorn afa.server.github:github_app --host 0.0.0.0 --port 3000Required environment variables for self-hosted:
AFA_GITHUB_APP_ID=<your-app-id>
AFA_GITHUB_PRIVATE_KEY_PATH=config/github-app.pem
AFA_GITHUB_WEBHOOK_SECRET=<your-secret>
AFA_GITHUB_INSTALLATION_ID=<your-installation-id>