You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
commit-check-action fails to halt pipeline when validation rules are violated #156
Unfortunately, commit-check/commit-check-action doesn't report any errors when I violate the branch name, conventional commit, or imperative checks.
The commit-check tool (used as part of pre-commit) works fine, but the GitHub Action version doesn't:
...
...
...
Type branch check failed ==> test123
It doesn't match regex: ^(feature|bugfix|hotfix|release|chore|feat|fix)\/.+|(master)|(main)|(HEAD)|(PR-.+)
The branch should follow Conventional Branch. See https://conventional-branch.github.io/
Suggest: Use <type>/<description> with allowed types or ignore_authors in config branch section to bypass
...
...
...
It doesn't match regex: ^(build|chore|ci|docs|feat|fix|perf|refactor|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)|(Merge).*|(fixup!.*)
The commit message should follow Conventional Commits. See https://www.conventionalcommits.org
Suggest: Use <type>(<scope>): <description> with allowed types
Type imperative check failed ==> test123 message
It doesn't match regex:
Commit message should use imperative mood (e.g., 'Add feature' not 'Added feature')
Suggest: Use imperative mood in the subject line
Example of the PR checked by commit-check/commit-check-action can be found here:
Activity
shenxianpeng commentedon Oct 26, 2025
Hi, it looks like your
.github/workflows/commit-check.ymlis missingref: ${{ github.event.pull_request.head.ref }}. for example:ruzickap commentedon Oct 26, 2025
Thank you...
It works...
ruzickap commentedon Oct 30, 2025
One more comment about the suggested solution above, which is using
ref: ${{ github.event.pull_request.head.ref }}The GitHub Security scans don't like it:
shenxianpeng commentedon Oct 30, 2025
Thanks for sharing this. I take a look at your workflow here, it might be
permissions: read-alltoo broad.Since I did not encounter this issue before, could you try updating the permissions to the following and see if it resolves the problem?
If this works, I’ll update the example accordingly.
ruzickap commentedon Nov 5, 2025
Actually, the problem is not in permissions but in this line:
ref: ${{ github.event.pull_request.head.ref }}.As mentioned above, commit-check doesn't work without the
ref:line.Example test:
In short - If I used the
ref: ${{ github.event.pull_request.head.sha }}parameter I and see the output:Without the
ref:parameter I got:Example pipeline here: https://github.com/ruzickap/gha-test/actions/runs/19091991765/workflow?pr=363
-> Anyway, by default, people usually just use the
actions/checkoutaction without specifying theref:, like this:-> Would it be possible to adjust the
commit-checkto function properly without relying on theref:parameter inactions/checkout?shenxianpeng commentedon Nov 5, 2025
commit-checkrelies on the branch name for checking the conventional branch usinggit branch --show-currenthttps://github.com/commit-check/commit-check/blob/106ea31d2c4f7bd430702c02c1dae99a4a000047/commit_check/util.py#L54
It is possible to get the branch name
if the user just provides a commit hash usinggit branch --contains <commit>but it will have a problem when a commit hash does not have a branch name (when the branch was merged and deleted)shenxianpeng commentedon Nov 5, 2025
Hi @ruzickap, thanks for the suggestion. I have support
commit-checkwithout requiringrefinactions/checkout.Please try the latest release:
commit-check/commit-check-action@v2orcommit-check/commit-check-action@v2.1.1and let me know if any issues.ruzickap commentedon Nov 6, 2025
Thank you...
Now it is working fine... :-)