Closed WadeZhouRiema closed 4 months ago
I found a better approach to the commitlint
:
npx commitlint --from=main --extends @commitlint/config-conventional -V
It means:
--from=main
: Fetch the commit messages from branch main
to this branch--extends
: Specifying the standards and rules without giving a configuration file-V
: Verbose mode to display how many commit messages are checkedSo we could simply extend our make ci
with:
.PHONY: ci
ci:
# The existing rules here...
# Install the dependencies...
npm i -g @commitlint/{cli,config-conventional}
npx commitlint --from=main --extends @commitlint/config-conventional -V
Since for most of the time our CI is triggered on PRs into the main
branch, and locally we could run the same command for dry-runs.
Closing this PR for a better approach.
Enable commit checker in github action. Commit message should be like "feat: xxx", "ci: xxx", "fix: xxx", etc. Otherwise the github action will fail.