feat(pr-lint): add workflow for linting pull request titles (#5790)

Signed-off-by: cuisongliu <cuisongliu@qq.com>
Co-authored-by: Yun Pan <dinoallo@netc.it>
This commit is contained in:
cuisongliu
2025-08-22 17:32:44 +08:00
committed by GitHub
co-authored by Yun Pan
parent de87d0aec4
commit bebae97bd2
3 changed files with 48 additions and 1 deletions
@@ -0,0 +1,43 @@
name: 'Lint PR title semantic'
on:
pull_request_target:
types:
- opened
- edited
- synchronize
jobs:
main:
runs-on: ubuntu-22.04
permissions:
pull-requests: write
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# https://github.com/amannn/action-semantic-pull-request
wip: true
# Default: https://github.com/commitizen/conventional-commit-types
types: |
feat
fix
docs
style
refactor
perf
test
build
ci
chore
revert
subjectPattern: ^(?![A-Z]).+$
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
doesn't start with an uppercase character.
requireScope: false
ignoreLabels: |
bot
headerPattern: '^(\w*)(?:\(([\w$.\-*/ ]*)\))?: (.*)$'
headerPatternCorrespondence: type, scope, subject
@@ -53,6 +53,8 @@ jobs:
branch: tagpr-new-${{ inputs.version }}
signoff: true
delete-branch: true
labels: |
bot
token: ${{ secrets.GITHUB_TOKEN }}
committer: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
+3 -1
View File
@@ -39,7 +39,7 @@ jobs:
- uses: peter-evans/create-pull-request@v5
if: ${{ (github.event_name == 'workflow_dispatch') && (steps.tagpr.outputs.version != '') }}
with:
title: 'Release ${{ steps.tagpr.outputs.name }} for ${{ steps.tagpr.outputs.version }}'
title: 'Release ${{ steps.tagpr.outputs.name }} note and fix version for ${{ steps.tagpr.outputs.version }}'
body: |
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
@@ -48,6 +48,8 @@ jobs:
branch: tagpr-${{ steps.tagpr.outputs.version }}
draft: true
signoff: true
labels: |
bot
delete-branch: true
token: ${{ secrets.GITHUB_TOKEN }}
committer: github-actions[bot] <github-actions[bot]@users.noreply.github.com>