feat[ci]: add PR title validation #27
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# jobs to validate pull request well-formedness | |
name: Validate PR metadata | |
on: | |
pull_request: | |
types: | |
- opened | |
- edited | |
- synchronize | |
permissions: | |
pull-requests: read | |
jobs: | |
conventional-commit: | |
name: Validate PR title | |
runs-on: ubuntu-latest | |
steps: | |
- uses: amannn/action-semantic-pull-request@v5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# https://github.com/amannn/action-semantic-pull-request?tab=readme-ov-file#configuration | |
with: | |
types: | | |
feat | |
fix | |
chore | |
refactor | |
# ci: continuous integration | |
# docs: documentation | |
# test: test suite | |
# lang: language changes | |
# ux: language changes (UX) | |
# tool: integration | |
# ir: (old) IR/codegen changes | |
# venom: venom changes | |
scopes: | | |
ci | |
docs | |
test | |
lang | |
ux | |
tool | |
ir | |
venom | |
requireScope: true | |
subjectPattern: '^(?![A-Z]).+$' | |
subjectPatternError: | | |
Starts with uppercase letter: '{subject}' | |
(Full PR title: '{title}') | |
headerPattern: '^(\w*)(?:\[([\w$.\-*/ ]*)\])?: (.*)$' | |
validateSingleCommit: true | |
validateSingleCommitMatchesPrTitle: true |