Branch Validation #3
Workflow file for this run
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 Validation | |
on: | |
create: | |
branches: | |
- '*' | |
jobs: | |
validate-branch-name: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check branch name | |
run: | | |
BRANCH_NAME="${GITHUB_REF#refs/heads/}" | |
if [[ ! "$BRANCH_NAME" =~ ^(feature|bugfix|release)/ ]]; then | |
echo "Invalid branch name prefix: $BRANCH_NAME. Must be one of 'feature|bugfix|release'." | |
exit 1 | |
fi |