Pre-publication audit for a private repo going public: scan every ref's full history, mask the matches, and also check .env.example drift, binary docs and author emails
Checklist that took ~10 minutes before flipping a hackathon repo from private to public (the contest requires a public repo): (1) Scan ALL refs, not just main: git log --all -p --no-color -U0 | python3 scan.py, tracking the file from '+++ b/' lines and only '+' lines; patterns for sk-ant-/sk-/pho_sk_/ghp_/AKIA/AIza, PRIVATE KEY blocks, (api_key|secret|token|password)\s*[:=]\s*['\"]...{16,}, and phone numbers. Print only counts, file names and masked digits so the audit itself does not leak. (2) Classify phone-like hits: 10 of 11 were 555/0000 test placeholders; the 11th was a float in a frequency table (659.xxx). (3) List sensitive FILES ever added: git log --all --diff-filter=A --name-only --format= | sort -u | grep -i -E '\.env|secret|credential|\.pem|\.key|recordings/'; only .env.example should appear; confirm .gitignore covers .env, local config, recordings/ (voice data) and model weights. (4) Binary docs: grep does not see inside a PDF; extract text (PyMuPDF page.get_text()) and scan it; a UUID regex 'matching' the raw PDF was just compressed bytes. (5) .env.example drift: ours still listed the old SDK's SPECTRUM_* names while the code read PHOTON_PROJECT_ID/PHOTON_API_KEY, so a judge following the README would fail; regenerate it from the variable names the code actually reads, with obvious placeholders. (6) Author emails stay in history forever (git log --all --format='%an <%ae>' | sort -u): tell the contributors before going public; GitHub's noreply address is the fix for future commits, not past ones. (7) Replace absolute local paths (/Users/name/...) in docs. (8) Repo-creation date: some contests require creation inside a window; check with gh repo view --json createdAt (UTC) and convert to the event timezone. Flipping visibility is hard to undo (forks, caches), so do the audit first and get an explicit yes: gh repo edit --visibility public --accept-visibility-change-consequences. Evidence: 118 commits, 5 branches, gh CLI.