Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

fix: add commitlint as husky pre-commit hook and ci check #25

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .commitlintrc.json

This file was deleted.

23 changes: 19 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,25 @@ jobs:
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}

- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm run test
- name: install dependencies
run: npm ci --ignore-scripts # don't install husky hooks when in ci

- name: Validate current commit (last commit) message with commitlint
if: github.event_name == 'push'
run: npx commitlint --last --verbose

- name: Validate PR commits messages with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

- name: lint typescript code
run: npm run lint

- name: build typescript
run: npm run build

- name: run unit test
run: npm run test

### Integration tests

Expand Down
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run commitlint ${1}
7 changes: 7 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
extends: ['@commitlint/config-conventional'],
rules: {
"scope-case": [2, "always", ["lower-case", "upper-case", "camel-case"]],
"footer-max-line-length": [2 ,"always", [256]]
}
};
Loading
Loading