Skip to content

fix: six correctness findings from a code-review sweep of src/ #116

fix: six correctness findings from a code-review sweep of src/

fix: six correctness findings from a code-review sweep of src/ #116

Workflow file for this run

name: Security Scan
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
gitleaks:
name: Secret scanning
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: gitleaks/gitleaks-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
custom-checks:
name: PII and policy checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Check for PII
run: |
HITS=$(grep -rnE "saenz|leesaenz|@gmail\.com" \
--include="*.py" --include="*.md" --include="*.toml" \
--include="*.json" --include="*.yml" --include="*.yaml" \
. 2>/dev/null | \
grep -v "^./LICENSE:" | grep -v "^./README.md:" | \
grep -v "^./scripts/pre-push:" | \
grep -v "^./scripts/check-pii.sh:" | \
grep -v "^./.github/workflows/security-scan.yml:" | \
grep -v "^\./.planning/" | grep -v "^\./.claude/" || true)
if [ -n "$HITS" ]; then
echo "::error::PII detected in files:"
echo "$HITS"
exit 1
fi
- name: Check for absolute paths
run: |
HITS=$(grep -rnE "/Users/[a-z]+/|/home/[a-z]+/|C:\\\\Users\\\\" \
--include="*.py" --include="*.md" --include="*.toml" \
--include="*.json" --include="*.yml" --include="*.yaml" \
. 2>/dev/null | \
grep -v "^\./.planning/" | grep -v "^\./.claude/" || true)
if [ -n "$HITS" ]; then
echo "::error::Absolute paths detected in files:"
echo "$HITS"
exit 1
fi
- name: Check for planning docs
run: |
if git diff --name-only origin/main...HEAD | grep -qE '^(\.planning/|\.claude/|docs/superpowers/)'; then
echo "::error::Planning/internal docs detected in PR"
exit 1
fi
semgrep:
name: Semgrep (SAST)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install Python 3.12
run: uv python install 3.12
- name: Semgrep scan
run: >
uv run --with semgrep semgrep scan
--config p/python
--config p/security-audit
--config p/command-injection
--error --metrics off src/