Skip to content

Commit 98a6202

Browse files
authored
chore(ci): add PR title linting (#66)
1 parent 5604339 commit 98a6202

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/commit-lint.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,29 @@ permissions:
99
pull-requests: read
1010

1111
jobs:
12+
lint-pr-title:
13+
name: Lint PR Title
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
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
34+
1235
commitlint:
1336
name: Lint Commit Messages
1437
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)