Skip to content
Discussion options

You must be logged in to vote

I usually keep sensitive values in environment variables and make sure .env files are included in .gitignore. I also avoid hardcoding API keys or database credentials directly into the source code.

For GitHub projects, Secret Scanning and push protection are useful extra layers of security. They can help catch exposed secrets before they become a bigger problem.

One thing I always keep in mind is that if a secret gets pushed accidentally, deleting it from the code isn't enough. You should revoke or rotate the exposed key immediately.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@Zephyron-afk
Comment options

@onetwothird
Comment options

Answer selected by Zephyron-afk
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Secret Scanning Detect and prevent the exposure of sensitive information in your code Code Security Build security into your GitHub workflow with features to keep your codebase secure Question Ask and answer questions about GitHub features and usage source:ui Discussions created via Community GitHub templates
3 participants