Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/commit-check.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[commit]
conventional_commits = true
subject_capitalized = false
subject_imperative = false
subject_max_length = 200
subject_min_length = 1
allow_commit_types = [
"fix",
"feat",
"build",
"chore",
"docs",
"style",
"refactor",
"remove",
"deprecate",
"security",
"add",
"perf",
"test",
]
Comment on lines +1 to +21

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Search for commit-check-action documentation or config schema references in the repo.
# Also check if the old committed.toml is still present (PR says it remains for now).

# Check for any documentation about commit-check config
rg -i "commit-check" --type yaml --type markdown -n -C3 || true

# Verify the old committed.toml still exists
fd "committed.toml" .github/

# Check if any other files reference commit-check.toml or its keys
rg -i "allow_commit_types\|conventional_commits\|subject_max_length\|subject_min_length\|subject_imperative" -n -C2 || true

Repository: cpp-linter/.github

Length of output: 432


🌐 Web query:

What is the config schema for commit-check-action v2.9.0 commit-check.toml? What are the valid config keys under the [commit] section?

💡 Result:

The commit-check-action v2.9.0 uses a TOML-based configuration file (typically named commit-check.toml or cchk.toml) to define validation rules [1][2]. The configuration is managed by the underlying commit-check engine [3][4]. Valid configuration keys under the [commit] section include: conventional_commits (bool): Enables or disables validation against the Conventional Commits specification [5][6]. message_pattern (str, optional): A custom regex pattern to validate commit messages, which overrides the conventional_commits rule [6]. subject_capitalized (bool): Enforces that the commit subject starts with a capital letter [5][6]. subject_imperative (bool): Enforces that the commit subject uses the imperative mood [5][6]. subject_max_length (int, optional): Sets the maximum allowed length for the commit subject [5][6]. subject_min_length (int, optional): Sets the minimum required length for the commit subject [5][6]. allow_commit_types (list[str]): A list of allowed commit types (e.g., feat, fix, chore) [5][6]. allow_merge_commits (bool): Whether merge commits are permitted [5][6]. allow_revert_commits (bool): Whether revert commits are permitted [5][6]. allow_empty_commits (bool): Whether empty commits are permitted [5][6]. allow_fixup_commits (bool): Whether fixup! commits are permitted [5][6]. allow_wip_commits (bool): Whether work-in-progress (e.g., WIP:) commits are permitted [5][6]. require_body (bool): Whether a body is required in the commit message [5][6]. require_signed_off_by (bool): Whether a "Signed-off-by" footer is required [5][6]. required_signoff_name (str, optional): A specific name required in the sign-off footer [6]. required_signoff_email (str, optional): A specific email required in the sign-off footer [6]. ignore_authors (list[str]): A list of author or co-author names to bypass commit checks (e.g., bots like dependabot[bot]) [5][7][6]. ai_attribution (str): Configures how AI-generated commit trailers are handled (e.g., ignore or forbid) [6]. Additionally, the configuration supports an inherit_from key at the root level to allow sharing and extending base configurations from other files, URLs, or GitHub repositories [1][2]. Users can also configure branch-specific rules under a separate [branch] section [5][6]. For IDE support, the schema is published on SchemaStore, allowing for automated validation and autocompletion in compatible editors [1].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== tracked commit-check files ==\n'
git ls-files '.github/*commit*' '.github/*cchk*' '.github/*toml' | sort

printf '\n== commit-check.toml ==\n'
if [ -f .github/commit-check.toml ]; then
  cat -n .github/commit-check.toml
fi

printf '\n== committed.toml ==\n'
if [ -f .github/committed.toml ]; then
  cat -n .github/committed.toml
fi

printf '\n== references ==\n'
rg -n "commit-check|committed\.toml|allow_commit_types|subject_max_length|subject_length|conventional_commits|subject_min_length|subject_imperative" .github -S || true

Repository: cpp-linter/.github

Length of output: 2006


Keep the subject length unlimited if that’s the intent
subject_max_length = 200 changes the previous unlimited subject_length = 0 behavior and will start rejecting longer subjects; use 0 or omit the cap if that restriction isn’t intended.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/commit-check.toml around lines 1 - 21, The commit subject length
setting in the commit-check config is now capped, which changes the previous
unlimited behavior. Update the commit validation config in the [commit] section
by adjusting subject_max_length in commit-check.toml so it preserves the
intended unlimited length (use 0 or remove the cap), and keep the
conventional_commits-related settings consistent with the existing validation
rules.

31 changes: 12 additions & 19 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
# No path set — checks out to workspace root so commit-check-action
# can auto-discover .github/commit-check.toml. Also provides
# cspell.config.yml as a fallback for consuming repos.
with:
persist-credentials: false
repository: cpp-linter/.github
Comment thread
shenxianpeng marked this conversation as resolved.
- name: Checkout ${{ github.repository }} repo
# needed for cspell.config.yml (project-specific)
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
Expand All @@ -51,13 +58,11 @@ jobs:
repository: ${{ github.repository }}
ref: ${{ github.sha }}
path: project-repo
- name: Checkout cpp-linter/.github (org) repo
# needed for committed.toml config (org-specific)
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: commit-check/commit-check-action@60e903b3fb06f5e64580b959f58d5b9406a3e002 # v2.9.0
with:
persist-credentials: false
repository: cpp-linter/.github
path: org-repo
message: false
branch: false
pr-title: true
- name: Get PR title
id: get-title
env:
Expand All @@ -67,18 +72,6 @@ jobs:
run: |-
pr_title=$(gh pr view "${PR_NUMBER}" --repo "${GH_REPO}" --json "title" -q ".title")
echo "title=${pr_title}" >> "${GITHUB_OUTPUT}"
- run: rustup update --no-self-update
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@732870f031d2fb36309d0deaf36abcc704a7be65 # v1.20.1
- name: Install committed
run: cargo binstall -y committed
env:
GITHUB_TOKEN: ${{ github.token }}
- name: conventional-commit
env:
PR_TITLE: "${{ steps.get-title.outputs.title }}"
COMMITTED_CONFIG: ${{ github.workspace }}/org-repo/.github/committed.toml
run: echo "${PR_TITLE}" | committed --config "${COMMITTED_CONFIG}" --commit-file -
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: latest
Expand All @@ -89,6 +82,6 @@ jobs:
if [ -f project-repo/cspell.config.yml ]; then
CSPELL_CONFIG="project-repo/cspell.config.yml"
else
CSPELL_CONFIG="org-repo/cspell.config.yml"
CSPELL_CONFIG="cspell.config.yml"
fi
echo "${PR_TITLE}" | npx cspell-cli lint --config "${CSPELL_CONFIG}" stdin