File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : PR commit message checks
2+
3+ on :
4+ pull_request :
5+ branches : [ '**' ]
6+
7+ concurrency :
8+ group : ${{ github.workflow }}-${{ github.ref }}
9+ cancel-in-progress : true
10+ # END OF COMMON SECTION
11+
12+ jobs :
13+ commit-messages :
14+ if : github.repository_owner == 'wolfssl'
15+ runs-on : ubuntu-24.04
16+ steps :
17+ - uses : actions/checkout@v4
18+ with :
19+ fetch-depth : 0
20+
21+ - name : Reject AI attribution trailers
22+ env :
23+ BASE_SHA : ${{ github.event.pull_request.base.sha }}
24+ HEAD_SHA : ${{ github.event.pull_request.head.sha }}
25+ run : |
26+ set -euo pipefail
27+ fail=0
28+ while IFS= read -r sha; do
29+ [ -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"
33+ git log -1 --format=' %h %s' "$sha"
34+ fail=1
35+ fi
36+ done < <(git rev-list "$BASE_SHA".."$HEAD_SHA")
37+ if [ "$fail" -ne 0 ]; then
38+ echo "One or more commits contain disallowed AI attribution trailers; please amend them out."
39+ exit 1
40+ fi
41+ echo "No disallowed AI attribution trailers found."
You can’t perform that action at this time.
0 commit comments