@@ -27,15 +27,35 @@ jobs:
2727 fail=0
2828 while IFS= read -r sha; do
2929 [ -z "$sha" ] && continue
30- if git log -1 --format=%B "$sha" | git interpret-trailers --parse | \
31- grep -iE '^(Co-authored-by|Signed-off-by):.*<?noreply@anthropic\.com>?' >/dev/null; then
32- echo "::error::Commit $sha contains a Co-authored-by or Signed-off-by trailer for noreply@anthropic.com"
30+ trailers=$(git log -1 --format=%B "$sha" | git interpret-trailers --parse)
31+ if echo "$trailers" | \
32+ grep -iE '^(Co-authored-by|Signed-off-by):.*<?noreply@(anthropic|openai)\.com>?' >/dev/null; then
33+ echo "::error::Commit $sha contains a Co-authored-by or Signed-off-by trailer for a disallowed AI vendor"
34+ git log -1 --format=' %h %s' "$sha"
35+ fail=1
36+ fi
37+ if echo "$trailers" | \
38+ grep -iE '^(Co-authored-by|Signed-off-by):.*<?[0-9]+\+Copilot@users\.noreply\.github\.com>?' >/dev/null; then
39+ echo "::error::Commit $sha contains a Co-authored-by or Signed-off-by trailer for GitHub Copilot"
40+ git log -1 --format=' %h %s' "$sha"
41+ fail=1
42+ fi
43+ if echo "$trailers" | \
44+ grep -iE '^(Co-authored-by|Signed-off-by):.*\[bot\]@users\.noreply\.github\.com>?' >/dev/null; then
45+ echo "::error::Commit $sha contains a Co-authored-by or Signed-off-by trailer for a bot account"
46+ git log -1 --format=' %h %s' "$sha"
47+ fail=1
48+ fi
49+ author_email=$(git log -1 --format=%ae "$sha")
50+ if echo "$author_email" | \
51+ grep -iE '\[bot\]@users\.noreply\.github\.com$' >/dev/null; then
52+ echo "::error::Commit $sha is authored by a bot account ($author_email)"
3353 git log -1 --format=' %h %s' "$sha"
3454 fail=1
3555 fi
3656 done < <(git rev-list "$BASE_SHA".."$HEAD_SHA")
3757 if [ "$fail" -ne 0 ]; then
38- echo "One or more commits contain disallowed AI attribution trailers ; please amend them out."
58+ echo "One or more commits contain disallowed AI attribution; please amend them out."
3959 exit 1
4060 fi
41- echo "No disallowed AI attribution trailers found."
61+ echo "No disallowed AI attribution found."
0 commit comments