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 : Lint Commit Messages
1+ name : Lint PR Title
22
33on :
44 pull_request :
5- types : [opened, edited, reopened, synchronize ]
5+ types : [opened, edited, reopened]
66
77permissions :
88 contents : read
3131 run : |
3232 echo "Validating PR title: $PR_TITLE"
3333 echo "$PR_TITLE" | npx commitlint --verbose
34-
35- commitlint :
36- name : Lint Commit Messages
37- runs-on : ubuntu-latest
38- steps :
39- - name : Checkout code
40- uses : actions/checkout@v4
41- with :
42- fetch-depth : 0 # Fetch all history for all branches and tags
43-
44- - name : Setup Node.js
45- uses : actions/setup-node@v4
46- with :
47- node-version : ' 20'
48-
49- - name : Install commitlint
50- run : |
51- npm install --save-dev @commitlint/cli@18.4.3 @commitlint/config-conventional@18.4.3
52-
53- - name : Validate PR commits
54- run : |
55- # Get the base branch (usually main)
56- BASE_SHA=$(git merge-base origin/${{ github.base_ref }} HEAD)
57-
58- # Lint all commits in the PR
59- npx commitlint --from $BASE_SHA --to HEAD --verbose
You can’t perform that action at this time.
0 commit comments