-
Notifications
You must be signed in to change notification settings - Fork 316
refactor: extract shared PR code review base configuration #22492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,38 @@ | ||||||||||
| --- | ||||||||||
| # Base configuration for AI-powered PR code review workflows | ||||||||||
| # Provides: cache-memory, GitHub PR tools, and review comment safe-outputs | ||||||||||
|
|
||||||||||
| tools: | ||||||||||
| cache-memory: true | ||||||||||
| github: | ||||||||||
| toolsets: [pull_requests, repos] | ||||||||||
|
|
||||||||||
| safe-outputs: | ||||||||||
| create-pull-request-review-comment: | ||||||||||
| side: "RIGHT" | ||||||||||
| submit-pull-request-review: | ||||||||||
| max: 1 | ||||||||||
| --- | ||||||||||
|
|
||||||||||
| ## PR Code Review Configuration | ||||||||||
|
|
||||||||||
| This shared component provides the standard tooling for AI pull request code review agents. | ||||||||||
|
|
||||||||||
| ### Available Tools | ||||||||||
|
|
||||||||||
| - **`cache-memory`** — Persist review history across runs at `/tmp/gh-aw/cache-memory/` | ||||||||||
| - Store previous review notes: `/tmp/gh-aw/cache-memory/pr-{number}.json` | ||||||||||
| - Avoid repeating comments seen in previous reviews | ||||||||||
| - **GitHub PR tools** — Access PR diffs, file changes, review threads, and check runs | ||||||||||
|
|
||||||||||
| ### Review Guidelines | ||||||||||
|
|
||||||||||
| 1. **Check cache first** — Read `/tmp/gh-aw/cache-memory/pr-${{ github.event.issue.number }}.json` to avoid re-stating previous comments | ||||||||||
| 2. **Use `get_diff`** — Fetch the actual diff to review line-by-line changes | ||||||||||
| 3. **Use `get_review_comments`** — Check existing review threads before adding new ones | ||||||||||
|
Comment on lines
+31
to
+32
|
||||||||||
| 2. **Use `get_diff`** — Fetch the actual diff to review line-by-line changes | |
| 3. **Use `get_review_comments`** — Check existing review threads before adding new ones | |
| 2. **Use `pull_request_read` with `method: get_diff`** — Fetch the actual diff to review line-by-line changes | |
| 3. **Use `pull_request_read` with `method: get_review_comments`** — Check existing review threads before adding new ones |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cache file path in these shared review guidelines hard-codes
github.event.issue.number, which will be empty for workflows triggered bypull_requestevents (e.g.,ready_for_review). This can lead to reading/writingpr-.jsonand losing the intended per-PR history. Use the same fallback pattern used elsewhere in this repo (e.g.,${{ github.event.issue.number || github.event.pull_request.number }}) for the cache filename.