-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Git hook failed on CI/CD git checkout #109
Comments
Hi @darthkurak, Typically, I'd recommend disabling Husky in CI/CD pipelines by setting the environment variable
(I haven't personally tested reinstalling Husky in post-checkout, but it's worth considering.) |
But how is disabling with HUSKY=0 supposed to work? |
You're right now I understand the problem, |
Version
Newest
Details
I have an advanced build system in Nuke for my .NET apps.
That build system makes sure that
dotnet husky install
is called each time when I build the app.It works almost perfectly fine.
I have one issue in CI/CD case.
When my Azure DevOps pipeline uses
git checkout
task, and this is not a first run - I am getting:.husky/post-checkout: 2: .: Can't open .husky/_/husky.sh
error.I debugged this and the flow is following:
git clean
which removes_/husky.sh
(because it is not committed) - but git hook already exists. So,git checkout
fails due to missing_/husky.sh
from.husky/post-checkout
.What is the best recommendation here?
I found a few workarounds, but I am not sure if they are valid and proper:
_/husky.sh
inpost-checkout
scriptdotnet husky install
inpost-checkout
script_/husky.sh
and change_/.gitignore
from*
tocache
- this one unfortunately is overridden each time when someone/something rundotnet husky install
Steps to reproduce
I described above.
The text was updated successfully, but these errors were encountered: