Skip to content

Commit

Permalink
chore: add commitlint as precommit & github action
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyxiao committed Dec 3, 2023
1 parent f439505 commit 5ad229f
Show file tree
Hide file tree
Showing 5 changed files with 520 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/check_conventional_commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Check PR title
on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: aslafy-z/conventional-pr-title-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run commitlint ${1}
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']}
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@
"test::ci": "pnpm run test --ci --forceExit --detectOpenHandles --runInBand",
"test::debug": "node --inspect-brk $(pnpm bin)/jest --runInBand --watch",
"test::watch": "pnpm run test --watch",
"test": "jest"
"test": "jest",
"commitlint": "commitlint --edit",
"prepare": "husky install"
},
"lint-staged": {
"**/*.{js,ts,tsx,json,css,yml,yaml}": "prettier --write",
"**/*.{js,ts,tsx}": "eslint --ext .js,.ts,.tsx --cache --fix"
},
"devDependencies": {
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@ianvs/prettier-plugin-sort-imports": "^4.1.1",
"@tsconfig/strictest": "^2.0.2",
"@types/jest": "^29.5.10",
Expand Down
Loading

1 comment on commit 5ad229f

@vercel
Copy link

@vercel vercel bot commented on 5ad229f Dec 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

opensdks – ./

opensdks-venice.vercel.app
opensdks.org
opensdks.vercel.app
opensdks-git-main-venice.vercel.app

Please sign in to comment.