#!/bin/sh

# Get the current branch name
BRANCH_NAME=$(git symbolic-ref --short HEAD)

# Regular expression to check branch name
if [[ ! "$BRANCH_NAME" =~ ^(feature|bugfix|hotfix|release|experiment|docs|refactor|perf|test|chore|ci|build|style|revert|deps|config)\/[a-z0-9\-]+$ && 
      ! "$BRANCH_NAME" =~ ^(develop|master|main|releases)$ ]]; then
  echo "ERROR: Branch name '$BRANCH_NAME' does not follow naming convention (e.g., feature/xyz, docs/api-docs, develop, master, main, releases)"
  exit 1
fi

exit 0
