Skip to content

Conversation

ehmicky
Copy link
Contributor

@ehmicky ehmicky commented Jan 12, 2022

Since upgrading to the latest version of Husky #403, the commitlint Git hook is now failing with:

/home/user/netlify/js-client/node_modules/@commitlint/cli/lib/cli.js:112
        throw err;
        ^

Error: Received 'HUSKY_GIT_PARAMS' as value for -E | --env, but environment variable 'HUSKY_GIT_PARAMS' is not available globally
    at getEditValue (/home/user/netlify/js-client/node_modules/@commitlint/cli/lib/cli.js:273:19)
    at normalizeFlags (/home/user/netlify/js-client/node_modules/@commitlint/cli/lib/cli.js:267:18)
    at main (/home/user/netlify/js-client/node_modules/@commitlint/cli/lib/cli.js:147:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Node.js v17.3.1
husky - commit-msg hook exited with code 1 (error)

Looking at Husky's and commitlint documentation, it appears the new version of Husky might require rewriting this hook, which this PR does. I tried it locally and this seems to work.

cc @XhmikosR

Checklist

Please add a x inside each checkbox:

  • I have read the contribution guidelines.
  • The status checks are successful (continuous integration). Those can be seen below.

@ehmicky ehmicky added the type: bug code to address defects in shipped code label Jan 12, 2022
@ehmicky ehmicky self-assigned this Jan 12, 2022
@ehmicky ehmicky merged commit 674068b into main Jan 12, 2022
@ehmicky ehmicky deleted the fix/commitlint-hook branch January 12, 2022 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug code to address defects in shipped code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants