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
10 changes: 10 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
# Reject commit messages that credit an AI assistant (Claude/Anthropic) as co-author.
# Shared with the team via core.hooksPath (.githooks), wired by the root "prepare" script.
# Server-side CI (.github/workflows/guard-commit-messages.yml) is the bypass-proof backstop
# for anyone who commits with --no-verify or without running `pnpm install`.
if grep -qiE '^[[:space:]]*co-authored-by:.*(claude|anthropic)' "$1"; then
echo "✖ commit-msg: commit messages must not credit Claude/Anthropic as co-author." >&2
echo " Remove the 'Co-Authored-By: ... claude/anthropic ...' line and try again." >&2
exit 1
fi
23 changes: 23 additions & 0 deletions .github/workflows/guard-commit-messages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Guard commit messages

on:
pull_request:

jobs:
no-ai-coauthors:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
- name: Reject AI co-author trailers
env:
BASE_REF: ${{ github.base_ref }}
run: |
git fetch origin "$BASE_REF" --depth=200
if git log "origin/$BASE_REF..HEAD" --format='%B' \
| grep -qiE '^[[:space:]]*co-authored-by:.*(claude|anthropic)'; then
echo "::error::A commit in this PR credits Claude/Anthropic as co-author. Remove the 'Co-Authored-By' trailer and force-update the branch."
exit 1
fi
echo "OK — no AI co-author trailers found."
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"name": "@org/source",
"version": "0.0.0",
"license": "MIT",
"scripts": {},
"scripts": {
"prepare": "git config core.hooksPath .githooks || true"
},
"private": true,
"dependencies": {
"@angular-devkit/build-angular": "21.2.7",
Expand Down