Skip to content

commit-check-action fails to halt pipeline when validation rules are violated #156

@ruzickap

Description

@ruzickap

I'm using a simple GitHub Actions workflow and a minimal commit-check.toml configuration since most defaults work well:

.github/workflows/commit-check.yml:

name: commit-check

on:
  pull_request:
    branches:
      - main
  workflow_dispatch:

permissions: read-all

jobs:
  commit-check:
    runs-on: ubuntu-24.04-arm
    steps:
      - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          fetch-depth: 0

      - uses: commit-check/commit-check-action@fc0543792ea1ba666c86fea9792d1d72e253ca97 # v2.1.0
        env:
          GH_TOKEN: ${{ github.token }}

commit-check.toml:

[commit]
subject_capitalized = false
subject_max_length = 72

[branch]
require_rebase_target = "origin/main"

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:

Thank you for looking at it...

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions