Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- local_branch="$(git symbolic-ref --short HEAD)"
- valid_branch_regex="^(feature|bugfix|improvement|library|prerelease|release|hotfix|maintenance).*\/[0-9._-]+$"
- # if [[ $local_branch =~ "^(bug|fix|bugfix|hotfix).*" ]]
- # then
- # prefix="BUG";
- # else
- # prefix="TASK";
- # fi
- message="There is something wrong with your branch name. Branch names in this project must adhere to this contract: [feature/bugfix/maintenance/hotfix]/[nadrzędne zagadnienie]. Your commit will be rejected. You should rename your branch to a valid name and try again."
- if [[ ! $local_branch =~ $valid_branch_regex ]]
- then
- echo "$message"
- exit 1
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement