Check Branch Name #57
Workflow file for this run
This file contains 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: 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 GitHub Actions / Check Branch NameInvalid workflow file
|
||
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 |