Handle dirty worktrees better and warn about running scripts/review.sh on untrusted code. (#21791)

This commit is contained in:
Jacob Richman
2026-03-10 09:38:26 -07:00
committed by GitHub
parent 556825f81c
commit 49ea9b0457
2 changed files with 8 additions and 2 deletions

View File

@@ -70,8 +70,10 @@ echo "review: Changing directory to $WORKTREE_PATH"
cd "$WORKTREE_PATH" || exit 1
# 4. Checkout the PR
echo "review: Checking out PR $pr..."
gh pr checkout "$pr" -f -R "$REPO"
echo "review: Cleaning worktree and checking out PR $pr..."
git reset --hard
git clean -fd
gh pr checkout "$pr" --branch "review-$pr" -f -R "$REPO"
# 5. Clean and Build
echo "review: Clearing possibly stale node_modules..."