ci: tighten README leak pattern to reduce false positives #47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Safety Check | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| check-for-leaked-content: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Block source code directories | |
| run: | | |
| FAILED=0 | |
| for dir in src .cargo .config; do | |
| if [ -d "$dir" ]; then | |
| echo "::error::BLOCKED: '$dir/' directory found — source code must not be in this repo" | |
| FAILED=1 | |
| fi | |
| done | |
| if [ $FAILED -eq 1 ]; then exit 1; fi | |
| echo "No forbidden directories found" | |
| - name: Block sensitive files | |
| run: | | |
| FAILED=0 | |
| for file in GEMINI.md AGENTS.md Cargo.toml Cargo.lock; do | |
| if [ -f "$file" ]; then | |
| echo "::error::BLOCKED: '$file' found — internal files must not be in this repo" | |
| FAILED=1 | |
| fi | |
| done | |
| if [ $FAILED -eq 1 ]; then exit 1; fi | |
| echo "No forbidden files found" | |
| - name: Block sensitive terms in README | |
| run: | | |
| SENSITIVE_PATTERN='BoringSSL|JA3|JA4|iptables|MITM.*(intercept|proxy|inject|swap)|extension[._ -]?server[._ -]?analysis|ls[._ -]?binary[._ -]?analysis|docs/(architecture|mitm)\.md|architecture\.md|mitm\.md' | |
| if grep -qiE "$SENSITIVE_PATTERN" README.md; then | |
| echo "::error::BLOCKED: README contains internal implementation details" | |
| grep -niE "$SENSITIVE_PATTERN" README.md | |
| exit 1 | |
| fi | |
| echo "README is clean" |