Opening a private repository gives everyone your whole history, not just the current files. Check these five things first.
1. Secrets, in the code and in history
Anything ever committed becomes public, even if a later commit deleted it. Scan for keys, tokens and passwords, and revoke any you find. See what to do when you commit a secret.
2. Vulnerable dependencies
Public code gets read by attackers looking for known flaws in your libraries. Update what you can, especially anything on the CISA KEV list.
3. Internal details
Look for internal hostnames, IP addresses, customer names, employee emails and comments about unfixed weaknesses. Check config files and test data.
4. Infrastructure files
Dockerfiles, Terraform and CI files show how you deploy. Fix open ports, public storage and overly broad permissions first. See checking Terraform and Dockerfile issues.
5. Licenses
Make sure you have the right to publish all the code, and choose a license for your own. Dependencies with restrictive licenses can limit your choice.
Run a scan
Scan the repository while it is still private to check items 1, 2, 4 and 5 in one go with the repository security check.