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
Automated review runs on `openai/codex-action`, driven by one workflow that
keeps the trigger gate, the model, and the review prompt in the same file.
Review is limited to maintainers: it runs when an owner, member, or
collaborator opens a pull request, and on demand when one of them comments
`/review`. An outside contributor's pull request never reaches a runner, so
untrusted code is never checked out and no review budget is spent on it. The
action verifies that the actor has write access as well, which leaves the
trigger gate as the cheap first barrier rather than the only one.
The prompt carries the standards that ruff and ty cannot check: the rule
against assuming infrastructure this package does not ship, tests arriving
with the behaviour they cover, Google-style docstrings, and strict typing.
Findings land as inline comments on the offending lines, and a review that
finds nothing posts a single `lgtm` comment.
The job runs in a `codex-review` environment, which scopes access to the
`OPENAI_API_KEY` the review needs. Without that secret the review fails and
reports nothing, which leaves merges unaffected.
Signed-off-by: Dere-Wah <derexcontact@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
You are a senior engineer reviewing this pull request. Act like a helpful team member who wants to improve code quality while being respectful of the author's work.
54
96
55
-
First, run `gh pr view <PR NUMBER> --json title,author` to get the PR title and author.
97
+
First, run `gh pr view $PR_NUMBER --json title,author` to get the PR title and author.
56
98
57
99
## What this repository is
58
100
@@ -63,10 +105,10 @@ jobs:
63
105
## Instructions
64
106
65
107
1. **CRITICAL: Check for existing review comments BEFORE reviewing the code.**
66
-
Run: `gh api repos/${{ github.repository }}/pulls/<PR NUMBER>/comments`
67
-
Parse the JSON and note each comment's `path`, `line`/`original_line`, and `body`, and whether it is from a previous bot review (look for "claude" or "github-actions" in the user login). Build a mental map of issues that have ALREADY been flagged.
108
+
Run: `gh api repos/$REPO/pulls/$PR_NUMBER/comments`
109
+
Parse the JSON and note each comment's `path`, `line`/`original_line`, and `body`, and whether it is from a previous bot review (look for "github-actions" in the user login). Build a mental map of issues that have ALREADY been flagged.
68
110
69
-
2. Review the PR diff using `gh pr diff <PR NUMBER>`.
111
+
2. Review the PR diff using `gh pr diff $PR_NUMBER`.
5. For each NEW issue you find (not previously commented on):
90
132
- Double-check the existing comments list — if a similar issue exists on the same file/line, SKIP IT
91
-
- Use `mcp__github_inline_comment__create_inline_comment` to comment directly on the specific line of code
133
+
- Comment directly on the specific line of code:
134
+
```bash
135
+
gh api repos/$REPO/pulls/$PR_NUMBER/comments \
136
+
-f body="<your comment>" \
137
+
-f commit_id="$PR_HEAD_SHA" \
138
+
-f path="<file path>" \
139
+
-F line=<line number> \
140
+
-f side="RIGHT"
141
+
```
92
142
- Keep comments concise (2-4 sentences max)
93
143
- Be specific about what's wrong and why
94
144
- Suggest a concrete fix when possible
95
145
96
146
6. Decide how to close out the review based on what you found:
97
147
- **If you found at least one new issue:** leave only the inline comments from step 5. Do not post a summary comment on top of them.
98
-
- **If you found no new issues at all:** post exactly one summary comment whose body is the single word `lgtm` (lowercase, nothing else). Before creating it, re-read the body you are about to submit and confirm it contains only `lgtm` — no preamble, no summary of the diff, no caveats, no extra whitespace or formatting — then create the comment with `gh pr comment <PR NUMBER> --body "lgtm"`.
148
+
- **If you found no new issues at all:** post exactly one summary comment whose body is the single word `lgtm` (lowercase, nothing else). Before creating it, re-read the body you are about to submit and confirm it contains only `lgtm` — no preamble, no summary of the diff, no caveats, no extra whitespace or formatting — then create the comment with `gh pr comment $PR_NUMBER --body "lgtm"`.
99
149
100
150
## Review Style
101
151
102
152
- Be constructive, not critical
103
153
- Explain the "why" behind suggestions
104
154
- Ask questions if intent is unclear rather than assuming it's wrong
105
155
- NEVER repeat yourself — if you've commented on something before, trust that the author saw it
0 commit comments