Making a repo public
History is public too, and publishing cannot be undone.
-
Scan the full history first, not only the tip, for secrets, personal paths (home directories, usernames), personal emails and private hostnames or IPs:
scripts/pii-scan.pywithpii-patterns.json, plus a secret scanner such as gitleaks overgit log -p --all. -
If history is not clean, publish from a squashed seed tree in a fresh repo: the cleaned tree, one initial commit, a new repo; the old repo stays private. A secret that was found is rotated by the owner regardless.
-
Security settings, all on before the visibility change (needs repo admin; a refusal goes to the owner):
Terminal window # secret scanning and push protectiongh api -X PATCH repos/<o>/<r> \-f 'security_and_analysis[secret_scanning][status]=enabled' \-f 'security_and_analysis[secret_scanning_push_protection][status]=enabled'# private vulnerability reportinggh api -X PUT repos/<o>/<r>/private-vulnerability-reporting# CodeQL default setupgh api -X PATCH repos/<o>/<r>/code-scanning/default-setup \-f state=configured -f query_suite=default# `release` environment restricted to v* tagsgh api -X PUT repos/<o>/<r>/environments/release \-F 'deployment_branch_policy[protected_branches]=false' \-F 'deployment_branch_policy[custom_branch_policies]=true'gh api -X POST repos/<o>/<r>/environments/release/deployment-branch-policies \-f name='v*' -f type=tag -
Dependabot (
.github/dependabot.yml, weekly, with acooldown; dependency policy) and aSECURITY.mdthat says to report privately and names scope. Confirm each setting with a read call, for examplegh api repos/<o>/<r>/private-vulnerability-reporting --jq .enabled. -
README and content pass against
README-STANDARD.md: curl every URL and badge, licence matchesLICENSE, no unverifiable claim, no internal hostname, no personal data. -
Only then change visibility. That step is the owner’s.