Skip to content

chore: add install step in homebrew formula #157

chore: add install step in homebrew formula

chore: add install step in homebrew formula #157

name: Branch Name Validation
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches-ignore:
- main
- dev
- development
jobs:
check-branch-name:
runs-on: ubuntu-latest
name: Validate branch naming convention
steps:
- name: Check branch name
run: |
# Get branch name from different contexts
if [ "${{ github.event_name }}" == "pull_request" ]; then
branch="${{ github.head_ref }}"
else
branch="${{ github.ref_name }}"
fi
echo "Checking branch: $branch"
# Skip protected branches
if [[ "$branch" == "main" || "$branch" == "dev" ]]; then
echo "✅ Branch '$branch' is a protected branch, skipping validation"
exit 0
fi
# Define the pattern for branch naming convention
# Format: type/issue-number-description
pattern='^(feature|fix|docs|chore|refactor)/[0-9]+-[a-z0-9-]+$'
# Check if branch name matches the pattern
if [[ ! "$branch" =~ $pattern ]]; then
echo "❌ Branch name '$branch' does not follow naming convention"
echo ""
echo "Required format: type/issue-number-description"
echo ""
echo "Valid types: feature, fix, docs, chore, refactor"
echo "Examples:"
echo " - feature/123-add-md025-rule"
echo " - fix/456-line-ending-detection"
echo " - docs/789-update-contributing-guide"
echo " - chore/101-update-dependencies"
echo " - refactor/202-rule-system-cleanup"
echo ""
echo "Please rename your branch to follow the convention."
exit 1
fi
echo "✅ Branch name '$branch' follows the naming convention"