Skip to content

Check Branch Name

Check Branch Name #49

name: Check Branch Name
on:
create:
jobs:
check-branch-name:
runs-on: ubuntu-latest
if: |

Check failure on line 8 in .github/workflows/check_branch_name.yml

View workflow run for this annotation

GitHub Actions / Check Branch Name

Invalid workflow file

The workflow is not valid. .github/workflows/check_branch_name.yml (Line: 8, Col: 9): Unexpected symbol: '['. Located at position 49 within expression: github.event.ref_type == 'branch' && !contains(['main', 'master', 'development', 'dev', 'develop'], github.ref) # ref_type check ensures the job only runs for branch creation, not tags
github.event.ref_type == 'branch' &&
!contains(['main', 'master', 'development', 'dev', 'develop'], github.ref) # ref_type check ensures the job only runs for branch creation, not tags
steps:
- name: Check Branch Name
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/}
if [[ ! $BRANCH_NAME =~ ^(features/|fixes/|releases/) ]]; then
echo "Invalid branch name. Must start with 'features/', 'fixes/', or 'releases/'."
exit 1
fi