Skip to content

ci: allow Co-authored-by trailers in commit-audit - #25

Merged
vyncint merged 1 commit into
mainfrom
ci/allow-coauthored-by-trailers
Aug 2, 2026
Merged

ci: allow Co-authored-by trailers in commit-audit#25
vyncint merged 1 commit into
mainfrom
ci/allow-coauthored-by-trailers

Conversation

@vyncint

@vyncint vyncint commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Problem

commit-audit (and its mirrored .githooks/commit-msg) scanned every commit message for a bare co-authored-by as a forbidden attribution pattern. But GitHub adds a Co-authored-by: trailer on every squash-merge (crediting the PR author under their <numeric-id>+user@users.noreply.github.com address, which differs from the local commit author) and to Dependabot commits. Those are legitimate, non-AI trailers — yet they tripped the required check on main after each merge.

This is what forced a history-rewrite + force-push after the last two merges, and it left main red again after the Dependabot group bump in #24 (c093ab0, which carries Co-authored-by: dependabot[bot] …).

Fix

Drop the bare co-authored-by term from the forbidden pattern in both the CI job and the mirrored hook:

- pattern='claude|anthropic|co-authored-by|generated with|ai-assisted'
+ pattern='claude|anthropic|generated with|ai-assisted'

AI attribution stays blocked — a Co-authored-by: Claude <…@anthropic.com> line is still caught by the claude/anthropic name terms (plus generated with / ai-assisted). Only neutral co-author trailers (a human, or a bot) are now allowed.

Verification

  • Full-history scan under the new pattern: 0 matches (clean) → this PR's own commit-audit passes.
  • Full-history scan under the old pattern: 1 match (the #24 Dependabot trailer) → confirms this was the cause of the red main.
  • Once merged, future squash-merges (including PR author + Dependabot trailers) stop tripping the check — no more force-push dance.

GitHub adds a Co-authored-by trailer to every squash-merge (crediting the
PR author under their numeric-id noreply address) and to Dependabot
commits. commit-audit and its mirrored commit-msg hook scanned for a bare
co-authored-by, so those legitimate trailers tripped the required check on
main after each merge — most recently the Dependabot group bump in #24,
which left main red.

Drop the bare co-authored-by term from the forbidden pattern in both
places. AI attribution stays blocked by the remaining name-based terms, so
an AI co-author trailer is still rejected.

Signed-off-by: Vyncint Ng <vyncint@users.noreply.github.com>
@vyncint
vyncint merged commit 6d5c117 into main Aug 2, 2026
22 checks passed
@vyncint
vyncint deleted the ci/allow-coauthored-by-trailers branch August 2, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant