You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repo provides a **reusable workflow** at `.github/workflows/review-pr.yml` that adds AI-powered PR reviews to any repository. It supports automatic reviews on PR open, manual `/review` comments, and feedback learning.
283
+
284
+
#### Setup (Explicit Secrets — No `secrets: inherit`)
285
+
286
+
This is the security-team-friendly approach. Only the secrets the workflow needs are passed explicitly — nothing else from your repository leaks across the boundary:
287
+
288
+
```yaml
289
+
name: PR Review
290
+
on:
291
+
issue_comment: # Enables /review command in PR comments
292
+
types: [created]
293
+
pull_request_review_comment: # Captures feedback on review comments for learning
294
+
types: [created]
295
+
pull_request_target: # Triggers auto-review on PR open; uses base branch context so secrets work with forks
CAGENT_ORG_MEMBERSHIP_TOKEN: ${{ secrets.CAGENT_ORG_MEMBERSHIP_TOKEN }} # PAT with read:org scope; gates auto-reviews to org members only
309
+
CAGENT_REVIEWER_APP_ID: ${{ secrets.CAGENT_REVIEWER_APP_ID }} # GitHub App ID; reviews appear as your app instead of github-actions[bot]
310
+
CAGENT_REVIEWER_APP_PRIVATE_KEY: ${{ secrets.CAGENT_REVIEWER_APP_PRIVATE_KEY }} # GitHub App private key; paired with App ID above
311
+
```
312
+
313
+
> **Why not `secrets: inherit`?** Using explicit secrets follows the principle of least privilege — the called workflow only receives the secrets it actually needs, not every secret in your repository. This is the recommended approach for public repos and security-conscious teams.
314
+
315
+
If you use a different LLM provider, replace `ANTHROPIC_API_KEY` with the appropriate secret (e.g., `OPENAI_API_KEY`, `GOOGLE_API_KEY`). See the full list in the secrets reference below.
316
+
317
+
#### Reusable Workflow Secrets Reference
318
+
319
+
| Secret | Required | Description |
320
+
| ------ | -------- | ----------- |
321
+
| `ANTHROPIC_API_KEY` | Yes* | Anthropic API key (or any one LLM key below) |
322
+
| `OPENAI_API_KEY` | No* | OpenAI API key |
323
+
| `GOOGLE_API_KEY` | No* | Google Gemini API key |
0 commit comments