Skip to content

Commit 0b70b76

Browse files
committed
ci: simplify co-author check
1 parent ce51cce commit 0b70b76

2 files changed

Lines changed: 5 additions & 17 deletions

File tree

.github/scripts/check-ai-co-authors.sh

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,11 @@ for pattern in "${AGENT_PATTERNS[@]}"; do
6666
fi
6767
done
6868

69-
# Collect Co-authored-by lines from every commit in the PR range.
70-
violations=""
71-
while IFS= read -r sha; do
72-
message="$(git log -1 --format='%B' "$sha")"
73-
matched_lines="$(echo "$message" | grep -iE "^Co-authored-by:" || true)"
74-
if [[ -z "$matched_lines" ]]; then
75-
continue
76-
fi
77-
78-
while IFS= read -r line; do
79-
if echo "$line" | grep -iqE "$regex"; then
80-
short="$(git log -1 --format='%h' "$sha")"
81-
violations="${violations} ${short}: ${line}"$'\n'
82-
fi
83-
done <<< "$matched_lines"
84-
done < <(git rev-list "${base_sha}..${head_sha}")
69+
violations="$(
70+
git log --format=' %h: %(trailers:key=Co-authored-by,separator=%x09)' \
71+
"${base_sha}..${head_sha}" |
72+
grep -iE "$regex" || true
73+
)"
8574

8675
if [[ -n "$violations" ]]; then
8776
echo "::error::AI agent Co-authored-by trailers detected in PR commits."

.github/workflows/ci-check-ai-co-authors.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Check AI Co-Authors
22

33
on:
44
pull_request:
5-
branches: ['*']
65

76
permissions:
87
contents: read

0 commit comments

Comments
 (0)