From cad16d53f7076d6c115613a31afdc1fbc975aa87 Mon Sep 17 00:00:00 2001 From: Chao Sun Date: Sat, 2 Mar 2024 11:22:55 -0800 Subject: [PATCH] build: Add checker for PR title (#151) --- .github/workflows/pr_build.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index aa69aea31..d905095e4 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -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: | + 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" + echo "Example: feat: Add support for sort-merge join" + exit 1 + fi +