You can now protect secrets from being committed to code for free on public repositories with the public beta release of secret scanning push protection. https://github.blog/2023-05-09-push-protection-is-generally-available-and-free-for-all-public-repositories/