fix(#202): replace GITHUB_TOKEN fallback with REVIEW_TOKEN in post-review CLI#507
fix(#202): replace GITHUB_TOKEN fallback with REVIEW_TOKEN in post-review CLI#507fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
…view CLI When --token is empty, the post-review CLI now falls back to REVIEW_TOKEN instead of GITHUB_TOKEN. In GitHub Actions, GITHUB_TOKEN inherits the workflow initiator identity, causing 422 self-review errors when the PR author matches the workflow identity (common in per-repo installs). The new resolveReviewToken helper enforces this priority: 1. Explicit --token flag value 2. REVIEW_TOKEN environment variable 3. Fail with a clear error explaining the GITHUB_TOKEN risk The --token flag help text is updated to document $REVIEW_TOKEN as the default source. Closes #202
E2E tests did not runE2E tests run automatically for org/repo members and collaborators on pull requests. For other contributors, a maintainer must add the See E2E testing guide for details. |
|
🤖 Finished Review · ✅ Success · Started 3:29 PM UTC · Completed 3:33 PM UTC |
ReviewVerdict: Approve SummaryClean, well-scoped fix that replaces the What the change does
AnalysisCorrectness: The function is straightforward and the test coverage is thorough. The Scope is appropriate: Only Security: This is a security improvement. Using a dedicated app installation token ( Style: The helper function follows existing Go idioms in this codebase. The error message is longer than typical but justified — it explains a non-obvious design choice that would otherwise puzzle users. No issues found. The change is minimal, correct, well-tested, and properly scoped. Labels: Bug fix in CLI post-review token resolution |
When --token is empty, the post-review CLI now falls back to REVIEW_TOKEN instead of GITHUB_TOKEN. In GitHub Actions, GITHUB_TOKEN inherits the workflow initiator identity, causing 422 self-review errors when the PR author matches the workflow identity (common in per-repo installs).
The new resolveReviewToken helper enforces this priority:
The --token flag help text is updated to document $REVIEW_TOKEN as the default source.
Closes #202
Post-script verification
agent/202-fix-review-token-fallback)b776cf6006a12016eaa21412dc65a3001100e801..HEAD)