-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: update to husky 8.0.3 and reactivate hook #839
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Logs are correctly showing "husky - Git hooks installed"
|
11a0ea4
to
6c3f528
Compare
6c3f528
to
378296f
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good on my end. I think the only think that changed within version 8 that was breaking was dropping support for Node v12, which shouldn't impact us.
You're right. We've already declared in https://github.com/cypress-io/github-action#nodejs-support that Node.js 14.x is the minimum version, so we're OK on that count. |
🎉 This PR is included in version 5.6.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR resolves #743 "Inactive git pre-commit Husky hook" by reactivating the husky hook.
It should also resolve an issue with Renovate. If dependencies which are used in the action are bumped by Renovate and they need to be compiled, Renovate does not know about this step and a PR it produces may be incomplete and fail the CI test .github/workflows/check-dist.yml.
Changes
"pre-commit": "npm run format && npm run build && git add index.js dist"
is migrated to.husky
for v8 usage.The scripts
npm run format
npm run build
are executed to determine if changes to the core of the action located in
index.js
dist/
need to be committed.
When running on Ubuntu the following will be observed:
Incomplete change made
If
index.js
was changed and theformat
andbuild
scripts were not manually run, then a user would see the following as an example when committing throughgit
. The following log output informs of the actions taken:The full log is as follows:
Complete change made
If
index.js
was changed and theformat
andbuild
scripts were manually run by the user, then they would see the following as an example when committing throughgit
:Similar output is shown also if files other than
index.js
are committed. The test is always done and the commit is only modified if necessary.Windows
When committing on Microsoft Windows there will be additional warnings from
git
such as"warning: in the working copy of 'index.js', LF will be replaced by CRLF the next time Git touches it" if the user has modified
index.js
and has not previously manually executednpm run format
andnpm run build
.Husky with GitHub Desktop on Windows
There have been multiple issues reported when attempting to use GitHub Desktop with Husky hooks enabled.
Workaround
Create an environment variable
Windows Settings > About > Advanced system settings > Environment Variables
to disable Husky if you are using GitHub Desktop on Microsoft Windows. If you are modifying
index.js
, then reset the environment variable in a terminal window sessionexport HUSKY=""
and commit usinggit commit
at the CLI level.