ci: enforce conventional pull request titles

Release-As: 0.4.0
This commit is contained in:
morluto
2026-07-12 21:53:20 +00:00
parent 4045d92623
commit 3a21f16c18
2 changed files with 20 additions and 4 deletions
+16
View File
@@ -7,6 +7,22 @@ on:
branches: [main]
jobs:
pr-title:
name: Conventional PR title
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Validate title for Release Please
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: >-
node -e 'const title = process.env.PR_TITLE ?? "";
const conventional = /^(?:feat|fix|docs|refactor|perf|test|build|ci|chore|revert)(?:\([a-z0-9._/-]+\))?!?: .+/u;
if (!conventional.test(title)) {
console.error("PR title must use Conventional Commits, for example: feat: add historical source import");
process.exit(1);
}'
typecheck:
name: Typecheck
runs-on: ubuntu-latest