Files
lxcong 4f9e63b636 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>
2026-04-23 13:57:09 +08:00

34 lines
795 B
YAML

name: Lint PR title
on:
pull_request:
types: [opened, edited, reopened, synchronize]
permissions:
pull-requests: read
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
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.