-
-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
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:
- When first run on Azure Devops agent - repository is freshly cloned, so, there is not git hooks yet.
- Then the build system is run, which calls "dotnet husky install" - and adds git hook
- Build succeed
- On the next pipeline run on this agent, the git checkout task makes
git cleanwhich removes_/husky.sh(because it is not committed) - but git hook already exists. So,git checkoutfails due to missing_/husky.shfrom.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:
- check for the existence of
_/husky.shinpost-checkoutscript - run
dotnet husky installinpost-checkoutscript - commit
_/husky.shand change_/.gitignorefrom*tocache- this one unfortunately is overridden each time when someone/something rundotnet husky install
Steps to reproduce
I described above.
Metadata
Metadata
Assignees
Labels
No labels