Skip to content

Commit 144391f

Browse files
pontemontiCopilot
andauthored
Update .claude/commands/review-pr.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent afd04b5 commit 144391f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.claude/commands/review-pr.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,18 @@ First, collect information about the pull request:
2222

2323
1. Get PR details, changed files, and the HEAD commit SHA:
2424
```bash
25-
gh pr view $ARGUMENTS --json number,title,body,baseRefName,headRefName,headRefOid,url,files
26-
gh pr diff $ARGUMENTS
25+
if [ -z "$ARGUMENTS" ]; then
26+
echo "Error: Missing PR number. Usage: /review-pr <PR_NUMBER>" >&2
27+
exit 1
28+
fi
29+
30+
if ! printf '%s\n' "$ARGUMENTS" | grep -Eq '^[0-9]+$'; then
31+
echo "Error: Invalid PR number '$ARGUMENTS'. PR number must be a positive integer. Usage: /review-pr <PR_NUMBER>" >&2
32+
exit 1
33+
fi
34+
35+
gh pr view "$ARGUMENTS" --json number,title,body,baseRefName,headRefName,headRefOid,url,files
36+
gh pr diff "$ARGUMENTS"
2737
```
2838

2939
2. Extract key information:

0 commit comments

Comments
 (0)