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
7 changes: 5 additions & 2 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/sh
# Reject any AI attribution in commit messages.
if grep -qiE 'claude|anthropic|co-authored-by|generated with|ai-assisted' "$1"; then
# Reject AI attribution in commit messages (Claude/Anthropic/"generated with"/
# "ai-assisted"). Plain Co-authored-by trailers are allowed: GitHub adds them on
# squash-merge and for Dependabot, and an AI co-author is still caught by the
# name patterns above.
if grep -qiE 'claude|anthropic|generated with|ai-assisted' "$1"; then
echo "commit-msg hook: forbidden attribution pattern found. Rewrite the message." >&2
exit 1
fi
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ jobs:
with:
fetch-depth: 0
# CI mirror of .githooks/commit-msg: scan every commit message in
# the repository for forbidden attribution patterns.
# the repository for AI attribution. Plain Co-authored-by trailers are
# allowed (GitHub adds them on squash-merge and for Dependabot); an AI
# co-author is still caught by the name patterns.
- name: audit commit messages
run: |
set -eu
pattern='claude|anthropic|co-authored-by|generated with|ai-assisted'
pattern='claude|anthropic|generated with|ai-assisted'
matches=$(git log --format='%H %s %b' | grep -icE "$pattern" || true)
if [ "$matches" -ne 0 ]; then
echo "commit-audit: forbidden attribution pattern found in commit messages:" >&2
Expand Down