From e0ddecf2a1186d500f55af00640a8868f7d74b97 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Fri, 26 Jun 2026 09:38:19 +0200 Subject: [PATCH 1/3] feat: add org-level commit-check.toml and dogfooding workflow - 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). --- .github/workflows/commit-check.yml | 25 +++++++++++++++++++++ commit-check.toml | 35 ++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/commit-check.yml create mode 100644 commit-check.toml diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml new file mode 100644 index 0000000..a1b9a79 --- /dev/null +++ b/.github/workflows/commit-check.yml @@ -0,0 +1,25 @@ +name: Commit Check + +on: + pull_request: + branches: 'main' + types: [opened, synchronize, reopened, edited] + workflow_dispatch: + +jobs: + commit-check: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - 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 + with: + message: true + branch: true + job-summary: true + pr-comments: true + pr-title: true diff --git a/commit-check.toml b/commit-check.toml new file mode 100644 index 0000000..96ba21e --- /dev/null +++ b/commit-check.toml @@ -0,0 +1,35 @@ +# ============================================================================ +# commit-check — org-level base configuration +# +# Repos within the commit-check org can inherit this config by placing the +# following directive at the top of their own commit-check.toml: +# +# inherit_from = "github:commit-check/.github:commit-check.toml" +# +# Local settings override the inherited values (shallow merge per section). +# See https://github.com/commit-check/commit-check for full documentation. +# ============================================================================ + +[commit] +# https://www.conventionalcommits.org +conventional_commits = true +subject_capitalized = false +subject_imperative = true +subject_max_length = 100 +subject_min_length = 5 +allow_commit_types = ["feat", "fix", "docs", "style", "refactor", "test", "chore", "ci"] +allow_merge_commits = true +allow_revert_commits = true +allow_empty_commits = false +allow_fixup_commits = true +allow_wip_commits = false +require_body = false +require_signed_off_by = false +ignore_authors = ["dependabot[bot]", "copilot[bot]", "pre-commit-ci[bot]", "coderabbitai[bot]"] + +[branch] +# https://conventional-branch.github.io/ +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"] From 92c87eaaa391dd21c2a7b91931edc250d0dc4212 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 26 Jun 2026 11:27:55 +0000 Subject: [PATCH 2/3] fix: fetch main ref before merge-base check in CI 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. --- .github/workflows/commit-check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml index a1b9a79..e07f0f6 100644 --- a/.github/workflows/commit-check.yml +++ b/.github/workflows/commit-check.yml @@ -16,6 +16,8 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v7.0.0 with: fetch-depth: 0 # Required for merge-base checks + - name: Ensure base branch ref exists for merge-base check + run: git fetch origin main:main - uses: commit-check/commit-check-action@v2.10.0 with: message: true From 0f04910fcf31b471c95fd0de65f87f6edce27d1f Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 26 Jun 2026 12:12:35 +0000 Subject: [PATCH 3/3] fix: remove require_rebase_target to avoid merge-base check in CI 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. --- .github/workflows/commit-check.yml | 2 -- commit-check.toml | 1 - 2 files changed, 3 deletions(-) diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml index e07f0f6..a1b9a79 100644 --- a/.github/workflows/commit-check.yml +++ b/.github/workflows/commit-check.yml @@ -16,8 +16,6 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v7.0.0 with: fetch-depth: 0 # Required for merge-base checks - - name: Ensure base branch ref exists for merge-base check - run: git fetch origin main:main - uses: commit-check/commit-check-action@v2.10.0 with: message: true diff --git a/commit-check.toml b/commit-check.toml index 96ba21e..3e79b39 100644 --- a/commit-check.toml +++ b/commit-check.toml @@ -31,5 +31,4 @@ ignore_authors = ["dependabot[bot]", "copilot[bot]", "pre-commit-ci[bot]", "code # https://conventional-branch.github.io/ 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"]