mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-27 05:24:34 -07:00
Handle dirty worktrees better and warn about running scripts/review.sh on untrusted code. (#21791)
This commit is contained in:
@@ -77,6 +77,10 @@ You can run the review tool in two ways:
|
|||||||
./scripts/review.sh <PR_NUMBER> [model]
|
./scripts/review.sh <PR_NUMBER> [model]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Warning:** If you run `scripts/review.sh`, you must have first verified
|
||||||
|
that the code for the PR being reviewed is safe to run and does not contain
|
||||||
|
data exfiltration attacks.
|
||||||
|
|
||||||
**Authors are strongly encouraged to run this script on their own PRs**
|
**Authors are strongly encouraged to run this script on their own PRs**
|
||||||
immediately after creation. This allows you to catch and fix simple issues
|
immediately after creation. This allows you to catch and fix simple issues
|
||||||
locally before a maintainer performs a full review.
|
locally before a maintainer performs a full review.
|
||||||
|
|||||||
+4
-2
@@ -70,8 +70,10 @@ echo "review: Changing directory to $WORKTREE_PATH"
|
|||||||
cd "$WORKTREE_PATH" || exit 1
|
cd "$WORKTREE_PATH" || exit 1
|
||||||
|
|
||||||
# 4. Checkout the PR
|
# 4. Checkout the PR
|
||||||
echo "review: Checking out PR $pr..."
|
echo "review: Cleaning worktree and checking out PR $pr..."
|
||||||
gh pr checkout "$pr" -f -R "$REPO"
|
git reset --hard
|
||||||
|
git clean -fd
|
||||||
|
gh pr checkout "$pr" --branch "review-$pr" -f -R "$REPO"
|
||||||
|
|
||||||
# 5. Clean and Build
|
# 5. Clean and Build
|
||||||
echo "review: Clearing possibly stale node_modules..."
|
echo "review: Clearing possibly stale node_modules..."
|
||||||
|
|||||||
Reference in New Issue
Block a user