Skip to content

chore(ci): check on branch name #3

chore(ci): check on branch name

chore(ci): check on branch name #3

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