chore(ci): check on branch name #3
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
on: | |
pull_request: | |
branches: | |
- main | |
- master | |
jobs: | |
check-branch-name: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Extract branch name | |
id: extract_branch | |
run: echo "${{ github.event.pull_request.title }}" | |
- name: Check if branch name follows conventional commit regex | |
run: | | |
BRANCH_REGEX='^(feat|fix|docs|style|refactor|perf|test|chore)\(?.+\)?: .+$' | |
if [[ "${{ github.event.pull_request.title }}" =~ $BRANCH_REGEX ]]; then | |
echo "Pull request name follows the conventional commit format." | |
else | |
echo "Pull request does not follow the conventional commit format." | |
exit 1 | |
fi |