1 Star 0 Fork 0

Bytedance Inc. / gopkg

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
check_branch_name.sh 477 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/env bash
basic="(master|develop|main)"
lints="((build|ci|chore|docs|feat|(hot)?fix|perf|refactor|revert|style|test)/.+)"
other="((release/v[0-9]+\.[0-9]+\.[0-9]+(-[a-z0-9.]+(\+[a-z0-9.]+)?)?)|revert-[a-z0-9]+)"
pattern="^(${basic}|${lints}|${other})$"
current=$(git status | head -n1 | sed 's/On branch //')
name=${1:-$current}
if [[ ! $name =~ $pattern ]]; then
echo "branch name '$name' is invalid"
exit 1
else
echo "branch name '$name' is valid"
fi
1
https://gitee.com/ByteDance/gopkg.git
git@gitee.com:ByteDance/gopkg.git
ByteDance
gopkg
gopkg
develop

搜索帮助