Skip to content

Commit ce245e3

Browse files
chore: add commitlint (#4)
* chore: checkout pr branch instead of merge commit in pr check wf * chore: add commitlint * chore: add husky
1 parent 386b5b2 commit ce245e3

5 files changed

Lines changed: 513 additions & 69 deletions

File tree

.github/workflows/pr-check.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
- name: Checkout
1414
uses: actions/checkout@v4
1515
with:
16+
ref: ${{github.event.pull_request.head.sha}}
1617
fetch-depth: 0
1718

1819
- name: Use Node.js
@@ -50,4 +51,4 @@ jobs:
5051
run: pnpm test
5152

5253
- name: Require changeset to be present in PR
53-
run: pnpm changeset status --since main
54+
run: pnpm changeset status --since origin/main

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit $1

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default { extends: ['@commitlint/config-conventional'] };

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{
2+
"type": "module",
23
"scripts": {
34
"test": "turbo test",
4-
"build": "turbo build"
5+
"build": "turbo build",
6+
"prepare": "husky"
57
},
68
"devDependencies": {
9+
"@commitlint/cli": "^19.2.1",
10+
"@commitlint/config-conventional": "^19.1.0",
11+
"husky": "^9.0.11",
712
"turbo": "latest"
813
},
914
"packageManager": "pnpm@8.9.0",

0 commit comments

Comments
 (0)