alliance-boreale/scripts/check_branch.sh
Dan Allaire 303dbedcdd
Some checks are pending
CI / yaml-lint (push) Waiting to run
CI / ssot-export (push) Waiting to run
CI / tests (push) Waiting to run
CI / docs (push) Waiting to run
docs(collab): conventions git, PR template, issue templates, CODEOWNERS
2025-10-26 10:56:03 -04:00

13 lines
474 B
Bash
Executable file

#!/usr/bin/env bash
# Validate branch name against {type}/{scope}-{desc}
set -euo pipefail
bname="$(git rev-parse --abbrev-ref HEAD)"
re='^(feat|fix|docs|ci|refactor|perf|test|chore|security|hotfix|release)\/[a-z0-9]+(-[a-z0-9]+)*$'
if [[ "$bname" =~ $re ]]; then
echo "Branch name OK: $bname"
exit 0
else
echo "ERROR: Branch '$bname' ne respecte pas la convention {type}/{scope}-{desc}."
echo "Exemples: feat/lot1-starter-kit, security/opa-policies-c5"
exit 1
fi