mapbox / secret-shield

Easily find secrets in files, directories, and repositories. Stop leaking secrets using git hooks.
MIT License
35 stars 13 forks source link

secretShield.checkAndRun() broken, prevents committing to repo #4

Open agius opened 6 years ago

agius commented 6 years ago

What repository are you running secret-shield on?

Private repo

What version of secret-shield are you running?

Unknown:

$ secret-shield --version
Unknown option: undefined
Usage: secret-shield <--string|--file|--directory|--repository> target
For detailed help run secret-shield --help or check the documentation.

How did you invoke secret-shield?

pre-commit via Husky - looks like it's running

#!/usr/bin/env node
'use strict';
const secretShield = require('@mapbox/secret-shield');
process.exit(secretShield.checkAndRun('2018-07-01'));

How is secret-shield not working as expected?

➜ my-repo (update-stuff) ✗ git commit -m 'Updates to stuff, remove dependency'
husky > pre-commit (node v8.10.0)
/bin/sh: Text.app/Contents/SharedSupport/bin:~/Applications/Sublime: No such file or directory
ERROR! You must have secret-shield installed and configured globally to commit to this repository. To set up secret-shield, follow these instructions: https://github.com/mapbox/secret-shield/blob/master/docs/enabledBadge.md
husky > pre-commit hook failed (add --no-verify to bypass)

⌦ my-repo (update-stuff) ✗ npm i -g @mapbox/secret-shield
/Users/andrewevans/.nvm/versions/node/v8.10.0/bin/secret-shield -> /Users/andrewevans/.nvm/versions/node/v8.10.0/lib/node_modules/@mapbox/secret-shield/bin/secret-shield.js
+ @mapbox/secret-shield@1.0.2
added 225 packages in 4.847s

➜ my-repo (update-stuff) ✗ git commit -m 'Updates to stuff, remove dependency'
husky > pre-commit (node v8.10.0)
/bin/sh: Text.app/Contents/SharedSupport/bin:~/Applications/Sublime: No such file or directory
ERROR! You must have secret-shield installed and configured globally to commit to this repository. To set up secret-shield, follow these instructions: https://github.com/mapbox/secret-shield/blob/master/docs/enabledBadge.md
husky > pre-commit hook failed (add --no-verify to bypass)

⌦ my-repo (update-stuff) ✗ which secret-shield
/Users/andrewevans/.nvm/versions/node/v8.10.0/bin/secret-shield

➜ my-repo (update-stuff) cat ~/.gitconfig | grep hooksPath
  hooksPath = /Users/andrewevans/.nvm/versions/node/v9.5.0/lib/node_modules/@mapbox/secret-shield/config/hooks

➜ my-repo (update-stuff) ✗ git commit -m 'Updates to stuff, remove dependency' --no-verify
[update-stuff 3551437] Updates to stuff, remove dependency
 3 files changed, 4522 insertions(+), 7 deletions(-)
 create mode 100644 package-lock.json

I don't know what it wants, so I gave up and used --no-verify . Error messages are totes bizarre. I expect PATH issues since I'm using nvm , but I have no idea why it would be checking Text.app/Contents... - that is for sure not on my PATH