chore: set up commitlint and git hooks
Some checks failed
Commit Message Check / conventional-commits (pull_request) Has been cancelled
Some checks failed
Commit Message Check / conventional-commits (pull_request) Has been cancelled
This commit is contained in:
19
.husky/pre-push
Executable file
19
.husky/pre-push
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
branch="$(git rev-parse --abbrev-ref HEAD)"
|
||||
|
||||
case "$branch" in
|
||||
main|develop)
|
||||
echo "Direct pushes to $branch are not allowed."
|
||||
echo "Please create a feature/... or bugfix/... branch and open a PR/MR."
|
||||
exit 1
|
||||
;;
|
||||
feature/*|bugfix/*|hotfix/*|chore/*)
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Invalid branch name: $branch"
|
||||
echo "Allowed branch prefixes: feature/*, bugfix/*, hotfix/*, chore/*"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user