A private repository was made public by mistake for two hours.
IntermediateScenarioSecrets, Signing and Security
Answer
Situation read → Assume it was cloned and scanned.
What I'd do →
- Make it private again immediately. Forks created while public stay public; delete them if possible through GitHub Support.
- Scan full history for secrets and rotate anything found.
- Check the audit log to see who changed visibility and why.
- Restrict the "change visibility" permission to org owners.
Why → Visibility changes are reversible, but exposure is not.
Interview tip → Org setting "Repository visibility change" prevents members from doing it.
More on Secrets, Signing and Security
A developer pushed an AWS access key to a public repo 10 minutes ago. What is your first move?BeginnerAfter rotating the leaked key, you must purge it from repository history. How?AdvancedA push is rejected: "GH013: Repository rule violations found ... Push cannot contain secrets". What do you do?IntermediateSecret scanning alerts have piled up, and many look like false positives or old test credentials.IntermediateYou must set up signed commits on your laptop. Which method do you pick?BeginnerYour GPG signing key expires next week. What is the correct way to handle it?Intermediate