Skip to content

Commit 0a4ddd8

Browse files
committed
fix(ci): replace commit-lint with standard commitlint workflow
Use the same commitlint-based PR title validation as dtvem.io and codingwithcalvin.net.
1 parent f8f0811 commit 0a4ddd8

1 file changed

Lines changed: 25 additions & 28 deletions

File tree

.github/workflows/commit-lint.yml

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,33 @@
1-
name: Commit Lint
1+
name: Lint Commit Messages
22

33
on:
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

1011
jobs:
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

0 commit comments

Comments
 (0)