Removing a key from a file doesn't remove it from your repo. How are you handling history scanning?
I always assumed deleting a key from a file was enough but from what I’ve learned that’s not how git works
Pre-commit hooks and CI only look at the diff. So if a key gets committed and you delete it in the next commit, every check turns out OK from then on, but the value is still sitting in history and still valid. The recommendation is to scan full history on a schedule and treat anything you find as exposed, and rotate it, even though it's long gone from the current files.
So the scan is really just telling you a leak already happened, and rotation is the part that actually contains it.
I have side projects from years ago where I don't remember what was committed before I knew better. Some of those keys are probably still valid.
Do you run scheduled history scans, or just pre-commit and CI? And when something surfaces from years back, do you rotate it or make a call based on whether the repo was ever public?