Skip to content

feat: add org-level commit-check.toml and dogfooding workflow#19

Merged
shenxianpeng merged 3 commits into
mainfrom
feature/add-org-level-commit-check-config
Jun 26, 2026
Merged

feat: add org-level commit-check.toml and dogfooding workflow#19
shenxianpeng merged 3 commits into
mainfrom
feature/add-org-level-commit-check-config

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

Create an org-level commit-check.toml as a single source of truth for commit and branch conventions across the commit-check org.

Changes

  1. commit-check.toml (root) — Org-level base configuration that all repos can inherit via:

    inherit_from = "github:commit-check/.github:commit-check.toml"
    • Enforces Conventional Commits and Conventional Branch naming
    • Includes common bot ignore lists (dependabot, copilot, pre-commit-ci, coderabbitai)
    • Allows AI agent branch prefixes (ai/, claude/, codex/, copilot/, cursor/)
  2. .github/workflows/commit-check.yml — Dogfooding workflow that runs commit-check on every PR to main of this repo, validating commit messages, branch names, and PR titles.

Usage in other repos

Add this to any repo's commit-check.toml:

inherit_from = "github:commit-check/.github:commit-check.toml"

# Local overrides (optional)
[commit]
subject_max_length = 72  # override for this repo

Note: The inherit_from feature is available since commit-check v2.5.0+.

Closes:

Summary by CodeRabbit

  • New Features
    • Added a “Commit Check” automation that validates pull request commit messages, branch names, and pull request titles, with support for manual runs.
  • Chores
    • Introduced repository-wide commit and branch formatting rules to keep history consistent.
    • Added allowlisted automation accounts to be excluded from these checks.

- Create commit-check.toml as the org-level base configuration for
  the commit-check org. Other repos can inherit it via:
    inherit_from = "github:commit-check/.github:commit-check.toml"
- Add .github/workflows/commit-check.yml to dogfood commit-check
  on the .github repo itself (validate commit messages, branch
  naming, and PR titles on every PR to main).
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@shenxianpeng, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 15 minutes and 20 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9a27f842-83fc-40de-b6a1-24fc7c9084a4

📥 Commits

Reviewing files that changed from the base of the PR and between 92c87ea and 0f04910.

📒 Files selected for processing (2)
  • .github/workflows/commit-check.yml
  • commit-check.toml
📝 Walkthrough

Walkthrough

This PR adds repository commit-check rules in commit-check.toml and a GitHub Actions workflow that runs commit-check on pull requests to main and on manual dispatch.

Changes

Commit Check Setup

Layer / File(s) Summary
Policy configuration
commit-check.toml
The TOML file defines commit validation rules, ignored authors, branch naming rules, a main rebase target, and branch-check ignored authors.
Workflow wiring
.github/workflows/commit-check.yml
The GitHub Actions workflow triggers on pull requests to main and manual dispatch, checks out full history, fetches the base branch ref, and runs commit-check-action with message, branch, summary, comment, and title checks enabled.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hop through checks with tidy paws,
New rules and workflows nibble at the cause.
On main I bound, with commits neat and bright,
Then nuzzle the branch checks late at night.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main changes: adding an org-level commit-check config and a dogfooding workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/add-org-level-commit-check-config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

Commit-Check ✔️

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with 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.

Inline comments:
In @.github/workflows/commit-check.yml:
- Line 19: The workflow step using commit-check/commit-check-action should be
pinned to an immutable full commit SHA instead of the mutable v2.10.0 tag.
Update the uses entry in the commit-check job to reference the exact SHA for
that release, matching the pinning approach already used by actions/checkout, so
the action reference is reproducible and not subject to upstream tag changes.

In `@commit-check.toml`:
- Line 35: The branch ignore list in commit-check.toml is missing
coderabbitai[bot], which will cause bot-authored PRs to fail validation
unexpectedly. Update the ignore_authors setting to restore coderabbitai[bot]
alongside the existing bot entries, and keep the shared-policy list aligned with
the base config around the commit-check configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b3c08bc3-9ece-49c4-ae57-994e4def25dc

📥 Commits

Reviewing files that changed from the base of the PR and between 570a4bb and e0ddecf.

📒 Files selected for processing (2)
  • .github/workflows/commit-check.yml
  • commit-check.toml

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v7.0.0
with:
fetch-depth: 0 # Required for merge-base checks
- uses: commit-check/commit-check-action@v2.10.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major

Pin commit-check-action to a full commit SHA.

Line 19 uses the mutable tag v2.10.0. Since this job has pull-requests: write permission (lines 12–14), using a mutable reference weakens supply-chain security. Pin commit-check-action to the specific commit SHA corresponding to v2.10.0 to ensure reproducible and secure execution, matching the pattern used for actions/checkout on line 16.

🧰 Tools
🪛 zizmor (1.26.1)

[error] 19-19: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 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/workflows/commit-check.yml at line 19, The workflow step using
commit-check/commit-check-action should be pinned to an immutable full commit
SHA instead of the mutable v2.10.0 tag. Update the uses entry in the
commit-check job to reference the exact SHA for that release, matching the
pinning approach already used by actions/checkout, so the action reference is
reproducible and not subject to upstream tag changes.

Comment thread commit-check.toml
conventional_branch = true
allow_branch_types = ["feature", "bugfix", "hotfix", "release", "chore", "feat", "fix", "ai", "claude", "codex", "copilot", "cursor"]
require_rebase_target = "main"
ignore_authors = ["dependabot[bot]", "copilot[bot]", "pre-commit-ci[bot]", "shenxianpeng"]

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 | 🟠 Major | ⚡ Quick win

Restore coderabbitai[bot] in the branch ignore list.

Line 35 diverges from both Line 28 and the stated shared-policy objective: coderabbitai[bot] is no longer ignored for branch checks, while shenxianpeng gets a repo-specific exemption in the org-wide base config. That will make bot-authored PRs fail branch validation unexpectedly.

🤖 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 `@commit-check.toml` at line 35, The branch ignore list in commit-check.toml is
missing coderabbitai[bot], which will cause bot-authored PRs to fail validation
unexpectedly. Update the ignore_authors setting to restore coderabbitai[bot]
alongside the existing bot entries, and keep the shared-policy list aligned with
the base config around the commit-check configuration.

@shenxianpeng shenxianpeng added the enhancement New feature or request label Jun 26, 2026
claude added 2 commits June 26, 2026 11:27
actions/checkout with fetch-depth: 0 does not create a local branch
ref for main, causing commit-check's require_rebase_target check to
fail with "Current branch is not rebased onto target branch".

Explicitly fetch origin/main to a local main ref so git merge-base
can resolve it correctly.
The merge-base check causes CI failures because actions/checkout does
not create a local main branch ref. Remove this option from the org
config since it cannot run reliably in a standard PR workflow.
@shenxianpeng shenxianpeng merged commit 2aeefa4 into main Jun 26, 2026
2 checks passed
@shenxianpeng shenxianpeng deleted the feature/add-org-level-commit-check-config branch June 26, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants