mirror of
https://github.com/LearningCircuit/local-deep-research.git
synced 2026-06-15 19:46:56 +03:00
fix: resolve subshell bug in whitelist-check and reduce output noise (#1231)
- Remove pipe before while loop to fix subshell issue where violation arrays were always empty (violations detected but never reported) - Replace per-file "Checking:" output with progress dots every 10 files - Add summary showing total files checked
This commit is contained in:
12
.github/scripts/file-whitelist-check.sh
vendored
12
.github/scripts/file-whitelist-check.sh
vendored
@@ -82,6 +82,7 @@ fi
|
||||
echo "🔍 Running comprehensive security checks..."
|
||||
echo ""
|
||||
|
||||
FILES_CHECKED=0
|
||||
WHITELIST_VIOLATIONS=()
|
||||
LARGE_FILES=()
|
||||
SECRET_VIOLATIONS=()
|
||||
@@ -96,7 +97,7 @@ HARDCODED_IP_VIOLATIONS=()
|
||||
SUSPICIOUS_FILETYPE_VIOLATIONS=()
|
||||
|
||||
# Use improved file processing that handles spaces and special characters
|
||||
printf '%s\n' "$CHANGED_FILES" | while IFS= read -r file; do
|
||||
while IFS= read -r file; do
|
||||
[ -z "$file" ] && continue
|
||||
|
||||
# Skip deleted files
|
||||
@@ -104,7 +105,10 @@ if [ ! -f "$file" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "Checking: $file"
|
||||
FILES_CHECKED=$((FILES_CHECKED + 1))
|
||||
if [ $((FILES_CHECKED % 10)) -eq 0 ]; then
|
||||
printf "."
|
||||
fi
|
||||
|
||||
# 1. Whitelist check
|
||||
ALLOWED=false
|
||||
@@ -310,6 +314,10 @@ fi
|
||||
fi
|
||||
done <<< "$CHANGED_FILES"
|
||||
|
||||
echo ""
|
||||
echo "✓ Checked $FILES_CHECKED files"
|
||||
echo ""
|
||||
|
||||
# Report all violations with detailed explanations
|
||||
echo "📊 Security scan completed. Analyzing results..."
|
||||
echo "📋 Summary of findings:"
|
||||
|
||||
Reference in New Issue
Block a user