How do I fix the broken CI/CD workflow?

tanaykmr

New member
Every time I make a commit on an active PR, I see the CI/CD workflow failing and get the attached notification.

Now, I'm aware that I need to remove these lines from my .husky/commit-msg
Code:
# !/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

But the issue is that if I go ahead and do that and then commit anything, the pre-commit hooks would automatically add this change even if it was not staged due to them having to account for any auto-generated docs.
This would lead to an unnecessary file change being pushed as a part of my PR.

How can I remove these lines without the pre-commit hooks adding the file to my commit?

1767203863471.webp
 
@tanaykmr, Fix this by adjusting your husky setup rather than committing the generated changes. You can add the generated files/dirs to .gitignore if they are not meant to be committed and if you're using lint-staged, make sure it only runs linters and not generators.
 
@PrincePrajapati7, this is an issue that all contributors face. Simply editing my local husky configuration would not be a long-term solution. Also, how would I even edit it to consistently stay the same? That is the challenge here.
 
Back
Top