Refactor security scanning and database setup
Some checks failed
Some checks failed
- Update security scan workflow to utilize a dedicated script for checking secrets, improving detection accuracy. - Modify database connection setup in multiple scripts to use an environment variable fallback for DATABASE_URL, enhancing flexibility in different environments.
This commit is contained in:
@@ -43,12 +43,12 @@ jobs:
|
||||
- name: Check for secrets
|
||||
run: |
|
||||
echo "🔍 Checking for potential secrets..."
|
||||
# Check for common secret patterns
|
||||
if grep -r -i "password\|secret\|key\|token" --include="*.js" --include="*.ts" --include="*.json" . | grep -v node_modules | grep -v ".git" | grep -v "package-lock.json" | grep -v "test"; then
|
||||
echo "⚠️ Potential secrets found in code"
|
||||
exit 1
|
||||
chmod +x scripts/check-secrets.sh
|
||||
if ./scripts/check-secrets.sh; then
|
||||
echo "✅ No secrets found in code"
|
||||
else
|
||||
echo "✅ No obvious secrets found"
|
||||
echo "❌ Secrets detected - please review"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Upload security scan results
|
||||
|
||||
Reference in New Issue
Block a user