Skip to content

Commit 8c8c679

Browse files
committed
chore: AI 표기 차단 commit-msg hook 추가
- 커밋 메시지에 AI 관련 attribution 패턴 감지 시 자동 차단 - .githooks/commit-msg에 배치, git config core.hooksPath로 활성화
1 parent 0d09bac commit 8c8c679

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.githooks/commit-msg

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
#
3+
# commit-msg hook: AI 관련 표기가 포함된 커밋을 차단합니다.
4+
# 설정: git config core.hooksPath .githooks
5+
#
6+
7+
COMMIT_MSG_FILE=$1
8+
COMMIT_MSG=$(cat "$COMMIT_MSG_FILE")
9+
10+
# 차단 패턴 (대소문자 무시)
11+
BLOCKED_PATTERNS="Co-Authored-By.*Claude|Co-Authored-By.*anthropic|Generated with Claude|Claude Code|noreply@anthropic"
12+
13+
if echo "$COMMIT_MSG" | grep -qiE "$BLOCKED_PATTERNS"; then
14+
echo ""
15+
echo "❌ 커밋 차단: AI 관련 표기가 포함되어 있습니다."
16+
echo ""
17+
echo "다음 패턴이 감지되었습니다:"
18+
echo "$COMMIT_MSG" | grep -iE "$BLOCKED_PATTERNS"
19+
echo ""
20+
echo "커밋 메시지에서 해당 내용을 제거해주세요."
21+
exit 1
22+
fi
23+
24+
exit 0

0 commit comments

Comments
 (0)