Skip to content

Commit

Permalink
chore(ci): check on branch name 3
Browse files Browse the repository at this point in the history
  • Loading branch information
mathias-vandaele committed Aug 13, 2024
1 parent 07a93e9 commit 2e5462c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/BRANCH_NAME_CHECK_ON_PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ jobs:
steps:
- name: Extract branch name
id: extract_branch
run: echo "::set-output name=branch::${GITHUB_HEAD_REF}"
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)\(?.+\)?: .+$'
echo ${{steps.extract_branch.outputs.branch}}
if [[ "${{ steps.extract_branch.outputs.branch }}" =~ $BRANCH_REGEX ]]; then
echo "Branch name follows the conventional commit format."
if [[ "${{ github.event.pull_request.title }}" =~ $BRANCH_REGEX ]]; then
echo "Pull request name follows the conventional commit format."
else
echo "Branch name does not follow the conventional commit format."
echo "Pull request does not follow the conventional commit format."
exit 1
fi

0 comments on commit 2e5462c

Please sign in to comment.