Skip to content

Commit

Permalink
chore(commitlint): replace commitizen by commitlint
Browse files Browse the repository at this point in the history
commitizen cannot lint commit in the CI so we switched to commitlint instead

fix #7
  • Loading branch information
Nargonath committed Oct 20, 2023
1 parent d20778e commit cbea69e
Show file tree
Hide file tree
Showing 7 changed files with 1,652 additions and 252 deletions.
2 changes: 1 addition & 1 deletion .czrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"path": "cz-conventional-changelog"
"path": "@commitlint/cz-commitlint"
}
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test

on: [pull_request]

jobs:
commitlint:
runs-on: ubuntu-22.04
steps:
- name: Fetch codebase
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "18.x"
- name: Install dependencies
run: npm ci
- name: Validate PR commits with commitlint
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
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"

npx --no -- commitlint --edit ${1}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

**All contributions are welcome!**

This project is setup with automatic semver versioning based on your commit semantic. It uses [`commitizen`](https://commitizen.github.io/cz-cli/) to enforce the format and help contributors format their commit message. We follow Angular's [conventional commit format](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines). Once you want to commit your work, you need to:
This project is setup with automatic semver versioning based on your commit semantic. It uses [`commitizen`](https://commitizen.github.io/cz-cli/) to enforce the format and help contributors format their commit message. We follow the [conventional commit format](https://www.conventionalcommits.org/en/v1.0.0/). Once you want to commit your work, you need to:

1. `git add` the changes you want to commit.
2. Run `npx cz` to start the commitizen CLI.
Expand Down
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
};
Loading

0 comments on commit cbea69e

Please sign in to comment.