File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Commit Lint
1+ name : Lint Commit Messages
22
33on :
44 pull_request :
5- types :
6- - opened
7- - edited
8- - synchronize
5+ types : [opened, edited, reopened, synchronize]
6+
7+ permissions :
8+ contents : read
9+ pull-requests : read
910
1011jobs :
11- lint :
12+ lint-pr-title :
13+ name : Lint PR Title
1214 runs-on : ubuntu-latest
1315 steps :
14- - name : Check PR title format
15- uses : amannn/action-semantic-pull-request@v5
16- env :
17- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
16+ - name : Checkout code
17+ uses : actions/checkout@v4
18+
19+ - name : Setup Node.js
20+ uses : actions/setup-node@v4
1821 with :
19- types : |
20- feat
21- fix
22- docs
23- style
24- refactor
25- perf
26- test
27- build
28- ci
29- chore
30- revert
31- requireScope : false
32- subjectPattern : ^[a-z].+$
33- subjectPatternError : |
34- The subject "{subject}" found in the pull request title "{title}"
35- didn't match the configured pattern. Please ensure that the subject
36- starts with a lowercase letter.
22+ node-version : ' 20'
23+
24+ - name : Install commitlint
25+ run : |
26+ npm install --save-dev @commitlint/cli@18.4.3 @commitlint/config-conventional@18.4.3
27+
28+ - name : Validate PR title
29+ env :
30+ PR_TITLE : ${{ github.event.pull_request.title }}
31+ run : |
32+ echo "Validating PR title: $PR_TITLE"
33+ echo "$PR_TITLE" | npx commitlint --verbose
You can’t perform that action at this time.
0 commit comments