chore: add gitguardian precommit checks #2109
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Devs like me may accidentally commit and push secrets to GitHub
Solution
Add GitGuardian pre-commit check to detect secrets and stop commits with secrets from being made. Devs are still able to manually override these checks if it's a false positive.
To enable secrets detection, the user must:
ggshield
on their local machine (unfortunately, no npm package is available)GITGUARDIAN_API_KEY
in.env
If neither of those are set up, the secrets detection check will be skipped.
Screenshots
Example of what happens when a secret is exposed (this test credential has already been revoked):