diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml new file mode 100644 index 0000000000..2171cf74dc --- /dev/null +++ b/.github/workflows/pr-lint.yml @@ -0,0 +1,14 @@ +name: pr-lint +on: [push, pull_request] +jobs: + PR-format-check: + runs-on: ubuntu-latest + steps: + - name: Check PR naming convention + run: | + title="${{ github.event.pull_request.title }}" + pattern="^(feat|fix|docs|style|refactor|perf|test|chore|revert|build|ci): .*" + if [[ ! $title =~ $pattern ]]; then + echo "PR title does not match naming convention. Example: 'feat: 添加新功能'" + exit 1 + fi \ No newline at end of file