Skip to content

Commit

Permalink
FS-65: Adding branch naming convention to pre-push hook (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
CLeopard99 authored Oct 23, 2024
1 parent 3483db5 commit 376ccb6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
branch_name=$(git rev-parse --abbrev-ref HEAD)
pattern="^FS-[0-9]+/[a-z0-9._-]+$"

if ! [[ $branch_name =~ $pattern ]]; then
echo "Branch name '$branch_name' does not follow the naming convention 'FS-<number>/<branch-name>', please rename using the following regex pattern and try again."
echo -e "\e[94m$pattern\e[0m"
exit 1
fi

0 comments on commit 376ccb6

Please sign in to comment.