Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: enable commit checker in github action #42

Closed
wants to merge 1 commit into from

Conversation

WadeZhouRiema
Copy link
Contributor

Enable commit checker in github action.
Commit message should be like "feat: xxx", "ci: xxx", "fix: xxx", etc. Otherwise the github action will fail.

@ghost
Copy link

ghost commented May 14, 2024

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 checked

So 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.

@ghost ghost closed this May 14, 2024
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant