Update git hooks to protect main branch and force good practices

This commit is contained in:
Pablo Baleztena 2024-09-18 22:46:53 -03:00
parent 3713812956
commit c5cf78510a

View File

@ -1,2 +1,9 @@
# .husky/pre-commit # .husky/pre-commit
yarn lint-staged yarn lint-staged
branch="$(git rev-parse --abbrev-ref HEAD)"
if [ "$branch" = "main" ]; then
echo "You can't commit directly to main branch"
exit 1
fi