Automated GitHub Pull Request code reviewer powered by OpenAI, Anthropic Claude, Google Gemini, or any OpenAI-compatible endpoint (Groq, DeepSeek, OpenRouter, Ollama, vLLM), combined with fast built-in security & code-quality heuristics.
- Multi-Provider AI Reviews: Switch seamlessly between
openai,anthropic,gemini,openai-compatible, orheuristic-only(zero API key required). - Deterministic Pre-Checks: Catches leaked private keys/tokens, disabled TLS checks,
eval()/new Function(), raw HTML XSS sinks, interpolated shellexec(), and leftover debugger statements before or alongside LLM analysis. - Line-Accurate Inline Comments: Parses unified diff hunks to anchor inline PR comments strictly on valid diff lines (
RIGHTside), preventing GitHub422errors and automatically moving overflow or out-of-hunk findings into the summary. - Sticky Summary & Deduplication: Updates a single summary comment (
<!-- diffpulse-ai-review -->) across pushes and skips duplicate inline comments. - Repo-Level Configuration: Optional
.github/diffpulse.ymlor.diffpulse.ymlfor team-wide prompts, globs, and thresholds. - Node 24 Native Action: Pre-bundled in
dist/index.jstargeting GitHub Actionsnode24with zero install step during workflow runs.
Create .github/workflows/code-review.yml in your repository:
name: AI Code Review
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
pull-requests: write
jobs:
review:
runs-on: ubuntu-latest
steps:
- name: Run DiffPulse AI Code Review
uses: jackydev95/diffpulse-ai-code-review@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
provider: openai
api-key: ${{ secrets.OPENAI_API_KEY }}
model: gpt-4o-mini
severity-threshold: low
review-event: AUTOAnthropic Claude
- uses: jackydev95/diffpulse-ai-code-review@v1
with:
provider: anthropic
api-key: ${{ secrets.ANTHROPIC_API_KEY }}
model: claude-sonnet-4-20250514Google Gemini
- uses: jackydev95/diffpulse-ai-code-review@v1
with:
provider: gemini
api-key: ${{ secrets.GEMINI_API_KEY }}
model: gemini-2.5-flashOpenAI-Compatible (OpenRouter / Groq / DeepSeek / Ollama)
- uses: jackydev95/diffpulse-ai-code-review@v1
with:
provider: openai-compatible
base-url: https://openrouter.ai/api/v1
api-key: ${{ secrets.OPENROUTER_API_KEY }}
model: anthropic/claude-3.5-sonnetHeuristic-Only (No LLM API Key Needed)
- uses: jackydev95/diffpulse-ai-code-review@v1
with:
provider: heuristic-only
fail-on-severity: high| Input | Default | Description |
|---|---|---|
github-token |
${{ github.token }} |
Token with pull-requests: write and contents: read. |
provider |
openai |
openai, anthropic, gemini, openai-compatible, or heuristic-only. |
api-key |
"" |
Provider API key (optional for heuristic-only or unauthenticated local endpoints). |
model |
Provider default | Model name (gpt-4o-mini, claude-sonnet-4-20250514, gemini-2.5-flash). |
base-url |
"" |
Custom API base URL (required for openai-compatible). |
custom-prompt |
"" |
Additional instructions appended to the review system prompt. |
review-event |
COMMENT |
COMMENT, APPROVE, REQUEST_CHANGES, or AUTO (REQUEST_CHANGES on high/critical). |
severity-threshold |
low |
Minimum severity to report: info, low, medium, high, critical. |
fail-on-severity |
none |
Fail the workflow check when findings meet or exceed this severity (none disables). |
include-patterns |
"" |
Comma or newline-separated globs to include (empty = all non-excluded files). |
exclude-patterns |
"" |
Additional glob patterns to exclude beyond built-in lockfiles/build artifacts. |
max-files |
40 |
Maximum number of changed files reviewed per run. |
max-diff-chars |
24000 |
Maximum character budget per LLM review batch. |
max-comments |
25 |
Maximum inline review comments posted per PR review. |
enable-heuristics |
true |
Run deterministic security and debug-artifact checks. |
skip-drafts |
true |
Skip draft pull requests. |
update-summary-comment |
true |
Maintain a single sticky PR summary comment. |
temperature |
0.1 |
Model sampling temperature (0 to 2). |
max-tokens |
2500 |
Max output tokens per batch. |
timeout-ms |
60000 |
HTTP request timeout per AI call in milliseconds. |
dry-run |
false |
Analyze diffs and log results without posting to GitHub. |
| Output | Description |
|---|---|
summary |
Generated review summary text. |
issues-count |
Total number of findings at or above severity-threshold. |
critical-count |
Count of critical findings. |
high-count |
Count of high findings. |
review-status |
completed, skipped, or failed. |
Teams can check in .github/diffpulse.yml (or .diffpulse.yml) to share defaults across workflows. See .github/diffpulse.example.yml for all supported keys. Explicit workflow with: inputs take precedence over file settings, while exclude_patterns are combined.
npm install
npm run typecheck
npm test
npm run buildRun a local review against your current git diff:
npm run review:local -- --provider heuristic-only
# Or with an LLM provider:
OPENAI_API_KEY=... npm run review:local -- --provider openai --model gpt-4o-mini- Authenticate GitHub CLI & create a public repository (GitHub Marketplace requires Actions to live in a public repository):
gh auth login git init -b main git add . git commit -m "feat: initial DiffPulse AI Code Review v1.0.0" gh repo create diffpulse-ai-code-review --public --source=. --remote=origin --push
- Verify
action.ymlname uniqueness: GitHub requiresname:inaction.ymlto be globally unique across GitHub Marketplace. IfDiffPulse AI Code Reviewis already taken when drafting your release, updatename:inaction.yml, commit, and push. - Draft a Release & Publish to Marketplace:
- Open your repository on GitHub (
https://github.com/jackydev95/diffpulse-ai-code-review) and click action.yml (you will see a banner: "Publish this Action to the GitHub Marketplace"), or go to Releases → Draft a new release. - Check "Publish this Action to the GitHub Marketplace", accept the GitHub Marketplace Developer Agreement if prompted, select primary category Code review (and optional secondary Code quality or Security).
- Set tag version to
v1.0.0, targetmain, and click Publish release. - The included
.github/workflows/release.ymlworkflow will automatically create/update the floatingv1tag so users can reference@v1.
- Open your repository on GitHub (
GitHub Actions on GitHub Marketplace are free-only. To monetize directly through GitHub Marketplace billing, this repo also includes a standalone GitHub App + Marketplace Billing Server (src/app/server.ts, bundled to dist/server.js) that reuses the same review engine.
| Plan | Model | Monthly | Yearly | Free Trial | Entitlements |
|---|---|---|---|---|---|
| Free | free |
$0 | $0 | — | Heuristics only, 50 PR reviews/month, up to 20 files |
| Pro Team | flat-rate |
$29/mo | $290/yr | 14 days | AI + heuristics, 500 PR reviews/month, .diffpulse.yml support |
| Business | per-unit |
$12/seat/mo | $120/seat/yr | 14 days | Unlimited PR reviews, up to 100 files, AUTO review approvals |
cp .env.example .env
# Fill GITHUB_APP_ID, GITHUB_APP_PRIVATE_KEY, GITHUB_WEBHOOK_SECRET, PLAN_ID_*, and AI_API_KEY
npm run build
npm run start:server- Webhook endpoint:
POST /webhooks/github(verifiesX-Hub-Signature-256, handlesmarketplace_purchaseandpull_requestevents) - Setup / Billing UI:
GET /billing(orGET /setup) andGET /api/billing/:accountId - Container deployment: ready via Dockerfile