Skip to content

commit-check-action passes even with non-Conventional Commits messages #184

@thedoom13

Description

@thedoom13

Hi,

I was testing it in one of my repositories and noticed something unexpected:

  • My commit messages do not follow the Conventional Commits format at all.
  • However, when I run the commit-check/commit-check-action in my CI workflow, it still reports success / pass.

Here is an example where I intentionally used non-compliant commits: thedoom13/commit-check#1

Is there any configuration option that I need to set to actually turn on strict Conventional Commits validation?

Thanks in advance!


My workflow snippet:

name: Commit Check

on:
  pull_request:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
  cancel-in-progress: true

permissions:
  contents: read
  pull-requests: write

jobs:
  commit-check:
    name: Commit-Check
    runs-on: ubuntu-latest
    if: >-
      !startsWith(github.head_ref, 'release-please-') && 
      !startsWith(github.head_ref, 'dependabot/')
    steps:
      - uses: actions/checkout@v5
        with:
          fetch-depth: 0
      - uses: commit-check/commit-check-action@v2
        with:
          message: true
          branch: false
          author-name: false
          author-email: false
          job-summary: true
          pr-comments: ${{ github.event_name == 'pull_request' }}

My commit-check.toml

[commit]
# https://www.conventionalcommits.org
conventional_commits = true
subject_capitalized = false
subject_imperative = false
allow_commit_types = ["feat", "fix", "docs", "style", "refactor", "perf", "test", "chore", "ci", "build"]
allow_merge_commits = true
allow_revert_commits = true
allow_empty_commits = true
allow_fixup_commits = true
allow_wip_commits = true
require_body = false
require_signed_off_by = false
ignore_authors = ["dependabot[bot]", "copilot[bot]", "pre-commit-ci[bot]"]

[branch]
# https://conventional-branch.github.io/
conventional_branch = true
allow_branch_types = ["feature", "bugfix", "hotfix", "release", "chore", "feat", "fix", "task"]
ignore_authors = ["dependabot[bot]", "copilot[bot]", "pre-commit-ci[bot]"]

When running the CLI directly, it correctly rejects messages that don't follow Conventional Commits:

echo "active room first, destroy deactive room descrypt, virtuoso rooms, reduce re-render room item" | commit-check -m -c ./commit-check.toml

Commit rejected by Commit-Check.

  (c).-.(c)    (c).-.(c)    (c).-.(c)    (c).-.(c)    (c).-.(c)
   / ._. \      / ._. \      / ._. \      / ._. \      / ._. \
 __\( C )/__  __\( H )/__  __\( E )/__  __\( C )/__  __\( K )/__
(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)
   || E ||      || R ||      || R ||      || O ||      || R ||
 _.' '-' '._  _.' '-' '._  _.' '-' '._  _.' '-' '._  _.' '-' '._
(.-./`-´\.-.)(.-./`-´\.-.)(.-./`-´\.-.)(.-./`-´\.-.)(.-./`-´\.-.)
 `-´     `-´  `-´     `-´  `-´     `-´  `-´     `-´  `-´     `-´

Commit rejected.

Type message check failed ==> active room first, destroy deactive room descrypt, virtuoso rooms, reduce re-render room item
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 subject_max_length check failed ==> active room first, destroy deactive room descrypt, virtuoso rooms, reduce re-render room item
It doesn't match regex: length=93, constraint=80
Subject must be at most 80 characters
Suggest: Keep the subject concise (<= configured max)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions