diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 769a8020..ee038c41 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -53,8 +53,6 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: self-test - run: sh scripts/check-attribution-trailers.sh --self-test - name: lint run: sh scripts/check-attribution-trailers.sh diff --git a/scripts/check-attribution-trailers.sh b/scripts/check-attribution-trailers.sh index 300e7e88..c2fc2b73 100755 --- a/scripts/check-attribution-trailers.sh +++ b/scripts/check-attribution-trailers.sh @@ -12,41 +12,10 @@ # # Scope is the PR's commits (BASE..HEAD), not entire history — old commits # must not fail the build. -# -# Run with --self-test to check the pattern against fixtures instead of -# scanning git history. set -eu trailer_re='^[[:space:]]*co-authored-by:.*(claude|anthropic|noreply@anthropic\.com)' -if [ "${1:-}" = "--self-test" ]; then - fail=0 - - assert_match() { - if ! printf '%s\n' "$2" | grep -qiE "$trailer_re"; then - echo "self-test FAILED (expected match): $1" >&2 - fail=1 - fi - } - assert_no_match() { - if printf '%s\n' "$2" | grep -qiE "$trailer_re"; then - echo "self-test FAILED (expected no match): $1" >&2 - fail=1 - fi - } - - assert_match "bare trailer" 'Co-Authored-By: Claude' - assert_match "full trailer with email" 'Co-Authored-By: Claude Sonnet 4.5 ' - assert_match "lowercase trailer" 'co-authored-by: claude' - assert_no_match "ordinary message" 'fix: correct off-by-one in parser' - assert_no_match "prose mention of the trailer" 'ops: add CI lint for Co-Authored-By/Claude/Anthropic trailers' - - if [ "$fail" -eq 0 ]; then - echo "self-test OK" - fi - exit "$fail" -fi - if [ -n "${GITHUB_BASE_REF:-}" ]; then base="origin/${GITHUB_BASE_REF}" else