#!/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)\/[a-z0-9\-]+$ && 
      ! "$BRANCH_NAME" =~ ^(develop|master|releases)$ ]]; then
  echo "ERROR: Branch name '$BRANCH_NAME' does not follow naming convention (e.g., feature/xyz, develop, master, releases)"
  exit 1
fi

exit 0
