-
Notifications
You must be signed in to change notification settings - Fork 934
How to run commitlint in GitHub workflow on every commit of a push #2568
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
Comments
Is this related to #586? |
@escapedcat yes, I think so. I created my workflow based on this question https://stackoverflow.com/questions/64708371/how-to-run-github-workflow-on-every-commit-of-a-push and I think I almost got it, I just need to fix my syntax but don't know how ... |
@escapedcat I updated my question, maybe this helps :) |
I think this comment provides a solution so your command should be
|
That didn't work for me. I had to tweak it to this:
|
## [1.3.1](v1.3.0...v1.3.1) (2023-07-15) ### Bug Fixes * **pullrequest-semantic:** fix commit range for commitlint ([2b19b3a](2b19b3a)), closes [/github.com/conventional-changelog/commitlint/issues/2568#issuecomment-830680965](https://github.com//github.com/conventional-changelog/commitlint/issues/2568/issues/issuecomment-830680965)
I created a new Github repository and followed https://commitlint.js.org/#/guides-local-setup. After that I created this workflow
to validate each commit message in a PR. I created a new branch and made a change 3 times with the following commit messages:
Expected Behavior
I would expect that commit message 1 and 3 are invalid so the workflow rejects the pull request.
Current Behavior
Unfortunately the validation passes.
I also tried this
run: npx commitlint --from ${{ github.base_ref }} --to ${{ github.head_ref }} --verbose
This time the workflow didn't pass but the output result is wrong
Affected packages
Possible Solution
As shown in the image I think my syntax is wrong and needs to get fixed.
Steps to Reproduce (for bugs)
Context
I would like to validate each commit message from commits in a PR
Your Environment
commitlint/cli --version
commitlint/config-conventional --version
git --version
node --version
The text was updated successfully, but these errors were encountered: