mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: prevent shell injection in pre-push hook environment loading (#9059)
This commit is contained in:
parent
1ba0150f7a
commit
37ac53ed4a
1 changed files with 10 additions and 7 deletions
|
|
@ -18,14 +18,17 @@ fi
|
|||
|
||||
$pnpm_cmd run check-types
|
||||
|
||||
# Load .env.local if it exists
|
||||
# Use dotenvx to securely load .env.local and run commands that depend on it
|
||||
if [ -f ".env.local" ]; then
|
||||
export $(grep -v '^#' .env.local | xargs)
|
||||
fi
|
||||
|
||||
# Run tests if RUN_TESTS_ON_PUSH is set to true
|
||||
if [ "$RUN_TESTS_ON_PUSH" = "true" ]; then
|
||||
$pnpm_cmd run test
|
||||
# Check if RUN_TESTS_ON_PUSH is set to true and run tests with dotenvx
|
||||
if npx dotenvx get RUN_TESTS_ON_PUSH -f .env.local 2>/dev/null | grep -q "^true$"; then
|
||||
npx dotenvx run -f .env.local -- $pnpm_cmd run test
|
||||
fi
|
||||
else
|
||||
# Fallback: run tests if RUN_TESTS_ON_PUSH is set in regular environment
|
||||
if [ "$RUN_TESTS_ON_PUSH" = "true" ]; then
|
||||
$pnpm_cmd run test
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check for new changesets.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue