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
Fix AI review workflow: fork permissions, payload size, comment posting
- Use pull_request_target for write permissions on fork PRs
- Use file-based jq input (--rawfile) instead of shell variables to
avoid arg limits on large diffs
- Use gh pr comment --body-file instead of heredoc to fix formatting
- Add HTTP status code logging for API call debugging
- Split into separate steps for clearer workflow logs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5. If proposals exist that match the PR topic, check alignment
94
+
6. Check if PR claims to fix already-fixed issues
95
+
96
+
Structure your review as: Critical Issues, Moderate Issues, Minor Issues, What Looks Good, Recommendation (approve/request changes).
97
+
98
+
Diff:
99
+
$(cat /tmp/pr.diff)
100
+
PROMPT
101
+
102
+
# Build JSON payload using jq with file input (no shell variable limits)
103
+
jq -n --rawfile prompt /tmp/user-prompt.txt '{
104
+
model: "openai/gpt-4.1",
105
+
messages: [
106
+
{
107
+
role: "system",
108
+
content: "You are a code reviewer for a Go CLI project (mxcli) that reads/modifies Mendix application projects. Key patterns: ANTLR4 grammar → AST → visitor → executor → BSON writer. Generated ANTLR parser files (mdl/grammar/parser/) are noise — note but skip. Review thoroughly but concisely."
content: "You are a code reviewer for a Go CLI project (mxcli) that reads/modifies Mendix application projects. Key patterns: ANTLR4 grammar → AST → visitor → executor → BSON writer. Generated ANTLR parser files (mdl/grammar/parser/) are noise — note but skip. Review thoroughly but concisely."
94
-
},
95
-
{
96
-
role: "user",
97
-
content: ("Review this PR.\n\nPR Info:\n" + $pr_info + "\n\nProject context:\n" + $context + "\n\nProposals in repo:\n" + $proposals + "\n\n" + $truncation + "\n\nFocus on:\n1. Bugs, logic errors, race conditions, resource leaks\n2. Error handling gaps\n3. Security concerns (command injection, temp files, predictable paths)\n4. Scope — flag if PR bundles unrelated changes\n5. If proposals exist that match the PR topic, check alignment\n6. Check if PR claims to fix already-fixed issues\n\nStructure: Critical Issues, Moderate Issues, Minor Issues, What Looks Good, Recommendation (approve/request changes).\n\nDiff:\n```\n" + $diff + "\n```")
0 commit comments