ci: validate PR title instead of commit messages (#2)

## Summary

The original `commitlint` workflow used
`wagoid/commitlint-github-action@v6` which validates commit messages,
not PR titles. Because the repo uses squash-merge with PR title as the
commit message, the PR title is the right surface to validate.

Replace with `amannn/action-semantic-pull-request@v5` which validates
the PR title directly. Job name kept as `commitlint` so branch
protection required-check context still resolves.

## Test plan

- Verified the current action lets bad PR titles through if commits
inside are conventional (closed test PR #1)
- This PR title follows the policy; new action should pass
- Post-merge smoke test: open a PR with a bad title like `test change`;
expect fail

Co-authored-by: lxcong <lxhtheresa@gmail.com>
This commit is contained in:
lxcong
2026-04-23 13:57:09 +08:00
committed by GitHub
parent b3d806105b
commit 4f9e63b636
+19 -6
View File
@@ -11,10 +11,23 @@ jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wagoid/commitlint-github-action@v6
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
configFile: .commitlintrc.json
firstParent: false
failOnWarnings: false
helpURL: https://www.conventionalcommits.org/
types: |
feat
fix
docs
chore
refactor
test
ci
perf
style
requireScope: false
subjectPattern: '^[a-z].+[^.]$'
subjectPatternError: |
The subject "{subject}" found in the PR title "{title}"
did not match the pattern. The subject must start with a lowercase
character and not end with a period.