Skip to content

Commit 76bcf00

Browse files
committed
ci: add commitlint to ci
Signed-off-by: Rafael Julio <development@rafifos.dev>
1 parent 4a975b0 commit 76bcf00

1 file changed

Lines changed: 31 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,40 @@ jobs:
4747
- name: Run tests
4848
run: pnpm test
4949

50+
commitlint:
51+
name: Jest
52+
runs-on: ubuntu-latest
53+
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v4
57+
58+
- uses: pnpm/action-setup@v4
59+
name: Install pnpm
60+
with:
61+
run_install: false
62+
63+
- name: Install Node.js
64+
uses: actions/setup-node@v4
65+
with:
66+
node-version: 22
67+
cache: 'pnpm'
68+
69+
- name: Install dependencies
70+
run: pnpm install
71+
72+
- name: Validate current commit (last commit) with commitlint
73+
if: github.event_name == 'push'
74+
run: pnpm dlx commitlint --last --verbose
75+
76+
- name: Validate PR commits with commitlint
77+
if: github.event_name == 'pull_request'
78+
run: pnpm dlx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
79+
5080
build:
5181
name: Build jsrepo Registry
5282
runs-on: ubuntu-latest
53-
needs: [quality, test]
83+
needs: [commitlint, quality, test]
5484
permissions:
5585
contents: write
5686

0 commit comments

Comments
 (0)