Added the examples for send message #1039
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Branch Naming Validation | |
| on: | |
| push: | |
| branches-ignore: | |
| - "main" | |
| jobs: | |
| validate-branch-name: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Validate branch naming convention | |
| run: | | |
| BRANCH_NAME="${{ github.ref_name }}" | |
| ACTOR="${{ github.actor }}" | |
| echo "🔍 Validating branch name: $BRANCH_NAME" | |
| echo "👤 Push author: $ACTOR" | |
| # Validate branch naming convention | |
| VALID_NAME=false | |
| ALLOWED_PATTERNS=( | |
| "^feature/" # New product features or major enhancements (org members only) | |
| "^fix/" # Bug fixes, typo corrections, broken links (anyone) | |
| "^docs/" # Documentation improvements and updates (anyone) | |
| "^chore/" # Maintenance tasks, dependency updates (org members only) | |
| "^community/" # General community contributions, examples (anyone) | |
| "^release/" # Release preparation branches (org members only) | |
| "^hotfix/" # Critical fixes for production issues (org members only) | |
| ) | |
| for pattern in "${ALLOWED_PATTERNS[@]}"; do | |
| pattern_name=$(echo "$pattern" | sed 's/\^//g' | sed 's/\///g') | |
| if [[ $BRANCH_NAME =~ $pattern ]]; then | |
| VALID_NAME=true | |
| echo "✅ Branch name follows convention: $pattern_name" | |
| break | |
| fi | |
| done | |
| if [ "$VALID_NAME" = false ]; then | |
| echo "❌ Branch name '$BRANCH_NAME' does not follow naming convention." | |
| echo "" | |
| echo "📋 Allowed branch prefixes:" | |
| echo "- feature/ (new product features - org members only)" | |
| echo "- fix/ (bug fixes, typos - anyone)" | |
| echo "- docs/ (documentation improvements - anyone)" | |
| echo "- chore/ (maintenance tasks - org members only)" | |
| echo "- community/ (community contributions - anyone)" | |
| echo "- release/ (release preparation - org members only)" | |
| echo "- hotfix/ (critical fixes - org members only)" | |
| echo "" | |
| echo "💡 Please rename your branch to follow the convention." | |
| exit 1 | |
| fi | |
| echo "✅ Branch naming validation successful - push authorized" |