From 86722d9455dece217904471e043238d8fc88e5fc Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Thu, 6 Aug 2026 15:08:34 +0000 Subject: [PATCH 1/2] ci: run commit-check on every PR, and check the title as it will land MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #530 passed review with a 75-character title and failed commit-check on main at 82, against a limit of 80 — the squash merge appended " (#530)" and pushed the subject over. Nothing had run on the pull request itself: main.yml's paths filter skipped the check because #530 touched only assets/, and the nox session checked HEAD, never the title a squash merge would actually commit. So: a dedicated workflow running commit-check-action on pull requests only, and the push-to-main check removed instead of taught to cope. Pull requests only, deliberately. A push to main carries work that already passed on its pull request, re-checked against a subject the author never wrote and cannot shorten. Dropping that removes the failure mode instead of predicting it. No paths filter — a subject, a branch name or an author address is wrong regardless of which files changed. The `edited` trigger re-checks when a title changes, because the title is what a squash merge commits; pr-title on the action checks it directly. The action rather than the nox session is also this repository checking itself with the thing users actually run. Known: CC202 fails on pull-request checkouts until the merge-base fix in commit-check ships and the action picks it up — the released engine cannot resolve a target that exists only as origin/main. That fix is a separate pull request; this one stays CI-only. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn --- .github/workflows/commit-check.yml | 45 ++++++++++++++++++++++++++++++ .github/workflows/main.yml | 3 -- 2 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/commit-check.yml diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml new file mode 100644 index 00000000..83f9de3d --- /dev/null +++ b/.github/workflows/commit-check.yml @@ -0,0 +1,45 @@ +name: Commit Check + +permissions: + contents: read + pull-requests: write # pr-comments writes back to the pull request + +on: + # Pull requests only, deliberately. + # + # A push to main carries the squashed commit, whose subject is the pull + # request title with " (#N)" appended by GitHub. Checking there re-runs work + # that already passed, against a subject the author never wrote and cannot + # shorten — which is how #530 passed review at 75 characters and then failed + # on main at 82, against a limit of 80. + # + # No `paths:` filter either. A subject, a branch name or an author address is + # wrong regardless of which files the change touches, and the filter on + # main.yml is why nothing ran on #530 at all: it changed only assets/. + # + # `edited` matters: a squash merge turns the title into the commit subject, + # so retitling a pull request changes what will be committed. + pull_request: + types: [opened, synchronize, reopened, edited] + +jobs: + commit-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 # full history, so branch and rebase checks can resolve + # Nothing after checkout needs authenticated git. + persist-credentials: false + # The action rather than a nox session: this repository is what the + # action installs, so running it here is the project checking itself + # with the thing users actually run. + - uses: commit-check/commit-check-action@124de73e3d47e0b4c1a89f70bbe1f17138c191ce # v2.13.0 + with: + message: true + branch: true + author-name: true + author-email: true + pr-title: true # the subject a squash merge will commit + job-summary: true + pr-comments: true diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 96c7b52a..1342fdef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,9 +41,6 @@ jobs: with: name: commit-check_wheel path: ${{ github.workspace }}/dist/*.whl - - name: Run commit-check - run: nox -s commit-check - - name: Collect Coverage run: nox -s coverage From 4ee18f3f82af3cdf7e6ff0d2340d2b0f69171a8e Mon Sep 17 00:00:00 2001 From: Xianpeng Shen Date: Fri, 7 Aug 2026 13:39:53 +0000 Subject: [PATCH 2/2] ci: bump commit-check-action to v2.13.1, which clears CC202 The pin was v2.13.0, whose requirements.txt installs commit-check 2.13.1. That engine cannot resolve a rebase target existing only as origin/main in a pull request checkout, so it reported "not rebased" for a branch that was -- the false CC202 this workflow has carried since its first run. v2.13.1 of the action installs commit-check 2.13.4, which carries the merge-base fix from #532. Confirmed by reading requirements.txt at the tag rather than assuming the action version tracks the engine version: v2.13.0 (124de73) -> commit-check==2.13.1 v2.13.1 (562a184) -> commit-check==2.13.4 The branch was already rebased before this change -- git merge-base --is-ancestor origin/main HEAD returned true while CC202 still failed -- so the failure was the engine, not the branch, and rebasing again could never have fixed it. Two things ride along on the newer engine. Skipped checks now report as skipped rather than as passes (#537), so a run bypassed by ignore_authors says so instead of showing green ticks over nothing. And the imperative whitelist goes from 396 verbs to 529, retiring a class of false CC003 -- 2.13.1 rejected "treat", which #527 had added three releases earlier. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn --- .github/workflows/commit-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml index 83f9de3d..2837bd4d 100644 --- a/.github/workflows/commit-check.yml +++ b/.github/workflows/commit-check.yml @@ -34,7 +34,7 @@ jobs: # The action rather than a nox session: this repository is what the # action installs, so running it here is the project checking itself # with the thing users actually run. - - uses: commit-check/commit-check-action@124de73e3d47e0b4c1a89f70bbe1f17138c191ce # v2.13.0 + - uses: commit-check/commit-check-action@562a184b2b8e583e757b17eb385bc48370f44547 # v2.13.1 with: message: true branch: true