Skip to content

Commit e2e74dd

Browse files
committed
chore: prevent committing on main branch
1 parent 263fb93 commit e2e74dd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.husky/pre-commit

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1+
branch_name=$(git symbolic-ref --short HEAD)
2+
3+
if [ "$branch_name" = "main" ]; then
4+
echo "ERROR: Direct commits to the 'main' branch are not allowed."
5+
exit 1
6+
fi
7+
18
pnpm lint-staged

0 commit comments

Comments
 (0)