Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Dhaiwat10/priv-key-precommit

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

priv-key-precommit

A simple precommit hook that checks for the presence of an Ethereum private key in your codebase.

Usage

  1. Install the package
yarn add -D priv-key-precommit
  1. Create a script in your package.json
"scripts": {
  "priv-key-check": "priv-key-precommit"
}
  1. Install husky (or a similar pre-commit hook manager)
npx husky-init && yarn
  1. Edit the contents of .husky/pre-commit
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run priv-key-check
  1. Try commiting your code. It won't let you commit your code if it finds a private key in your codebase.
❯ git commit -m 'test'

> priv:check
> priv-key-precommit

🚨 Found 1 instance(s) of private keys. Aborting commit.
=> .env.example
husky - pre-commit hook exited with code 1 (error)

About

A simple precommit hook that checks for the presence of an Ethereum private key in your codebase

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.