Conversation
Add opt-in auto-approve that uses Claude to evaluate whether a PR should be approved based on a repo-specific scope prompt. After the review completes, the evaluation considers the diff, changed files, and extracted findings to make an approve/reject decision. New inputs: - auto_approve: enable the feature (default: false) - auto_approve_app_id: GitHub App ID for generating approval token - auto_approve_private_key: GitHub App private key - auto_approve_scope_prompt: repo-specific criteria for Claude Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @Cali93's task in 2s —— View job PR Review
🔒 External Domain URL (Non-blocking) URL: Found 3 issue(s)Issue 1: stdout contamination breaks auto-approve featureID: auto-approve-eval-stdout-contamination-b3f1 Context:
Recommendation: Change // In github-utils.js, or locally override for this script:
log: (...args) => process.stderr.write(`[${scriptName}] ` + args.join(' ') + '\n'),Or, in APPROVED=$(echo "$RESULT" | tail -1 | jq -r '.approved')
REASON=$(echo "$RESULT" | tail -1 | jq -r '.reason')Issue 2: Command injection via
|
Add inputs table entries, setup guide (GitHub App creation, private key, secrets), usage examples (terraform, docs-only, dependency bumps), and how-it-works explanation to the README. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix stdout contamination: logger now writes to stderr so stdout
contains only the final JSON result, preventing jq parse failures
- Fix command injection: pass AUTO_APPROVE_REASON as an env var instead
of interpolating it directly into the shell script via ${{ }}
- Add input validation step: fail early with a clear error when
auto_approve is true but app credentials are missing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
arein
left a comment
There was a problem hiding this comment.
2nd thought - SOC2 Type 2 binds us to get human reviews. So we will need to get this past our SOC 2 Type 2 auditor before rolling it out
Summary
New Inputs
auto_approvefalse)auto_approve_app_idauto_approve_private_keyauto_approve_scope_promptSetup (one-time, org-wide)
1. Create a GitHub App
Go to your org Settings → Developer settings → GitHub Apps → New GitHub App:
Claude Reviewer(must be unique across GitHub)2. Generate a private key
On the App's settings page, scroll to "Private keys" → "Generate a private key". Save the downloaded
.pemfile.3. Install the App
App settings → "Install App" → select your org → choose "All repositories" or select specific repos.
4. Add org secrets
Go to Org Settings → Secrets and variables → Actions → New organization secret:
CLAUDE_REVIEWER_APP_ID— the App ID (visible on the App's "General" settings page)CLAUDE_REVIEWER_PRIVATE_KEY— the full contents of the.pemprivate key file5. Update your workflow (per-repo)
How It Works
findings.json(unchanged)auto-approve-evaluation.jscalls the Anthropic API with the diff + changed files + review findings + scope prompt{ approved: true/false, reason: "..." }Test plan
🤖 Generated with Claude Code