Pre-commit hook fails with "error: Unable to read baseline."
Closed this issue · 1 comments
-
I'm submitting a ...
- bug report
- feature request
-
What is the current behavior?
-
Getting "error: Unable to read baseline." when registering git pre-commit hook
-
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
-
Run
detect-secrets scan > .secrets.baseline
-
Install pre-commit and register pre-commit hook as described on https://microsoft.github.io/code-with-engineering-playbook/continuous-integration/dev-sec-ops/secret-management/recipes/detect-secrets/
-
git add
something and commit -
Commit fail with
Detect secrets...........................................................Failed
- hook id: detect-secrets
- exit code: 1
usage: detect-secrets-hook.EXE [-h] [-v] [--version] [-C <path>]
[-c NUM_CORES] [--json] [--baseline FILENAME]
[--list-all-plugins] [-p PLUGIN]
[--base64-limit [BASE64_LIMIT]]
[--hex-limit [HEX_LIMIT]]
[--disable-plugin DISABLE_PLUGIN]
[-n | --only-verified]
[--exclude-lines EXCLUDE_LINES]
[--exclude-files EXCLUDE_FILES]
[--exclude-secrets EXCLUDE_SECRETS] [-f FILTER]
[--disable-filter DISABLE_FILTER]
[filenames ...]
error: Unable to read baseline.
-
What is the expected behavior?
-
Commit succeeds since no new secrets are added.
-
What is the motivation / use case for changing the behavior?
-
The tool is unusable as it is now.
-
Please tell us about your environment:
- detect-secrets Version: 1.4.0
- Python Version: 3.11.7
- OS Version: Microsoft Windows 10 Business version 10.0.19045 Build 19045.
- File type (if applicable): secrets baseline file
secrets.baseline.txt (renamed to allow upload to github).
-
Other information
File encoding was UTF-16 BOM. Converted to UTF-8 and fixed the issue.