From a8ad4fe2c691aa319590e26a38d2e904898b0a78 Mon Sep 17 00:00:00 2001 From: Norton-Lin <358154247@qq.com> Date: Mon, 18 Nov 2024 16:16:51 +0800 Subject: [PATCH] feat: add pull request check --- .github/workflows/prcheck.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/prcheck.yml diff --git a/.github/workflows/prcheck.yml b/.github/workflows/prcheck.yml new file mode 100644 index 0000000..e04bd43 --- /dev/null +++ b/.github/workflows/prcheck.yml @@ -0,0 +1,20 @@ +name: Pull Request Title Check + +on: + pull_request: + branches: + - main + - dev + +jobs: + pr-title-check: + runs-on: ubuntu-latest + steps: + - name: Check pull request title + env: + PR_TITLE: ${{ github.event.pull_request.title }} + run: | + if ! echo "$PR_TITLE" | grep -Eq "^(feat|fix|docs|style|refactor|test|chore): .+"; then + echo "❌ Pull request title does not follow the conventional format (e.g., 'feat: description')" + exit 1 + fi