Skip to content

Commit

Permalink
build: Add checker for PR title
Browse files Browse the repository at this point in the history
  • Loading branch information
sunchao committed Mar 1, 2024
1 parent 1f53e25 commit 842d9ca
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/pr_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,18 @@ jobs:
- if: matrix.test-target == 'java'
name: Java test steps
uses: ./.github/actions/java-test
check-pr-title:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check PR title
env:
PR_TITLE: ${{ github.event.pull_request_title }}
run: |
echo "PR title = $PR_TITLE"
if ! echo $PR_TITLE | grep -Eq '^(\w+)(\(.+\))?: .+$'; then
echo "PR title does not follow conventional commit style."
echo "Please use a title in the format: type: message, or type(scope): message"
exit 1
fi

0 comments on commit 842d9ca

Please sign in to comment.