Skip to content

Improve slot prefetch: full booking window with client-side merging #27

Improve slot prefetch: full booking window with client-side merging

Improve slot prefetch: full booking window with client-side merging #27

Workflow file for this run

name: Secret Scan
on:
push:
branches: ['*']
pull_request:
branches: ['*']
jobs:
secret-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Scan for secrets in source files
shell: bash
run: |
echo "Scanning for potential secrets in source files..."
FOUND=0
SCAN_DIRS="frontend backend tests docs"
SCAN_INCLUDE="--include=*.js --include=*.html --include=*.css --include=*.gs --include=*.json --include=*.yaml --include=*.yml"
check_pattern() {
local label="$1"
local pattern="$2"
local matches
matches=$(grep -rn $SCAN_INCLUDE -E "$pattern" $SCAN_DIRS 2>/dev/null || true)
if [ -n "$matches" ]; then
echo "WARNING: Potential $label found:"
echo "$matches"
FOUND=1
fi
}
check_pattern "AWS Access Key" 'AKIA[0-9A-Z]{16}'
check_pattern "API secret key" 'sk-[a-zA-Z0-9]{20,}'
check_pattern "GitHub token" 'ghp_[a-zA-Z0-9]{36}'
check_pattern "Google API key" 'AIza[0-9A-Za-z_-]{35}'
check_pattern "Google OAuth token" 'ya29\.[0-9A-Za-z_-]+'
SECRET_FILES=$(find . -maxdepth 3 \( -name '.env' -o -name '.env.*' -o -name 'credentials.json' -o -name 'token.json' \) -not -path '*/node_modules/*' -not -path '*/.git/*' 2>/dev/null || true)
if [ -n "$SECRET_FILES" ]; then
echo "WARNING: Potential secret files found:"
echo "$SECRET_FILES"
FOUND=1
fi
if [ "$FOUND" -eq 1 ]; then
echo ""
echo "Secret scan FAILED. Remove secrets before pushing."
exit 1
else
echo "No secrets detected."
fi