GitHub Actions Integration
Automate code reviews on every pull request with Bop and GitHub Actions. This guide covers setup, configuration, and troubleshooting.
Quick Start
Add this workflow to .github/workflows/bop-review.yml:
| |
That’s it. One API key, one step, automatic PR reviews.
Action Inputs
| Input | Default | Description |
|---|---|---|
anthropic-api-key | Anthropic API key (recommended) | |
openai-api-key | OpenAI API key (optional) | |
google-api-key | Google Gemini API key (optional) | |
base-ref | main | Base branch to compare against |
block-threshold | none | Severity threshold for blocking (critical, high, medium, low, none) |
reviewers | Comma-separated reviewer personas | |
post-findings | true | Post findings as PR review comments |
fail-on-findings | false | Fail the workflow if findings are detected |
log-level | info | Log level (trace, debug, info, error) |
version | latest | Bop version to install (e.g., v0.7.2) |
Required Secrets
Configure at least one API key in your repository settings (Settings > Secrets and variables > Actions):
| Secret | Required | Description |
|---|---|---|
ANTHROPIC_API_KEY | Recommended | Anthropic Claude API key |
OPENAI_API_KEY | Optional | OpenAI GPT API key |
GEMINI_API_KEY | Optional | Google Gemini API key |
The GITHUB_TOKEN is automatically provided by GitHub Actions.
Permissions
The workflow requires these permissions:
| |
Configuration Options
Using Action Inputs
| |
Using a Config File
Include a bop.yaml or .bop.yaml in your repository root for full configuration:
| |
Block Threshold
The block-threshold input controls when the action fails (blocks the PR):
| Value | Blocks On |
|---|---|
critical | Only critical findings |
high | Critical and high findings |
medium | Critical, high, and medium |
low | All findings |
none | Never blocks (comment only) |
Skip Triggers
Skip reviews on certain commits by including keywords in the commit message:
[skip bop][bop skip][skip review][no review]
Example:
| |
Advanced Workflows
Review Only on Specific Paths
| |
Multiple Providers
| |
Pin a Specific Version
| |
Branch Protection Integration
Configure branch protection to require Bop reviews:
- Go to Settings > Branches > Branch protection rules
- Click Add rule for your main branch
- Enable Require status checks to pass before merging
- Search for and select the Bop workflow job name
Output and Artifacts
Step Summary
Bop writes a summary to the GitHub Actions step summary, visible on the workflow run page.
SARIF Upload
Upload SARIF results to GitHub Code Scanning:
| |
Artifact Upload
Save review artifacts for later analysis:
| |
Manual Installation (Alternative)
If you prefer not to use the composite action:
| |
Platform Integration (Coming Soon)
Bop Pro will add OIDC-based platform authentication for GitHub Actions, enabling:
- Keyless authentication (no API key secrets needed)
- Centralized team configuration
- Usage analytics and budget controls
To prepare for OIDC, add this permission to your workflow:
| |
Troubleshooting
“Resource not accessible by integration”
This error means the GITHUB_TOKEN lacks permissions. Ensure your workflow has:
| |
“No findings posted”
- Check that
post-findingsistrue(default) - Verify the PR has actual code changes (not just markdown)
- Check the workflow logs for errors
“Rate limited”
LLM providers have rate limits. Solutions:
- Reduce the number of reviewers
- Skip review on certain paths (documentation, etc.)
- Use faster/cheaper models in your config
Timeout Issues
Large PRs may timeout. Solutions:
Increase workflow timeout:
1 2 3jobs: review: timeout-minutes: 30Use faster models in your
bop.yaml:1 2 3 4reviewers: quick: provider: gemini model: gemini-3-flash-previewSplit large PRs into smaller ones
Debug Mode
Enable debug logging:
| |
Cost Considerations
Each PR review uses LLM API tokens. Estimated costs vary by:
- PR size: Larger diffs = more tokens
- Number of reviewers: More reviewers = more API calls
- Verification: Enabling verification adds ~30% cost
To manage costs:
- Use the default single reviewer (cheapest option)
- Use faster models (Gemini Flash) for custom reviewers
- Skip verification on non-critical repos
- Use path filters to skip non-code files
Security Best Practices
- Use secrets for API keys - Never hardcode API keys
- Limit permissions - Only grant required permissions
- Review workflow changes - Require approval for workflow modifications
- Enable redaction - Prevent secrets in code from reaching LLMs