This is an automated email from the ASF dual-hosted git repository.

yihua pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new 3c74ecf1eace chore(ci): add commit co-author validation as a required 
PR check (#19134)
3c74ecf1eace is described below

commit 3c74ecf1eace3841a9bc82cf5a2aabd6c66cffca
Author: Y Ethan Guo <[email protected]>
AuthorDate: Wed Jul 1 21:23:37 2026 -0700

    chore(ci): add commit co-author validation as a required PR check (#19134)
---
 .asf.yaml                                        |  1 +
 .github/workflows/commit_coauthor_validation.yml | 38 ++++++++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/.asf.yaml b/.asf.yaml
index 107bf7cc7add..e49a60b1f185 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -50,6 +50,7 @@ github:
           - validate-source
           - validate-pr
           - validate-pr-title
+          - validate-commit-coauthor
           - test-hudi-trino-plugin
           - test-spark-client-and-hadoop-common (scala-2.12, spark3.5, 
flink2.1)
           - test-utilities (scala-2.12, spark3.5, flink2.1)
diff --git a/.github/workflows/commit_coauthor_validation.yml 
b/.github/workflows/commit_coauthor_validation.yml
new file mode 100644
index 000000000000..765b64315125
--- /dev/null
+++ b/.github/workflows/commit_coauthor_validation.yml
@@ -0,0 +1,38 @@
+name: Commit Co-author Validation
+
+on:
+  pull_request:
+    types: [opened, reopened, synchronize]
+    branches:
+      - master
+      - branch-0.x
+
+concurrency:
+  group: commit-coauthor-validation-${{ github.ref }}
+  cancel-in-progress: ${{ !contains(github.ref, 'master') && 
!contains(github.ref, 'branch-0.x') }}
+
+jobs:
+  validate-commit-coauthor:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Check commits for Claude co-author trailers
+        env:
+          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          REPO: ${{ github.repository }}
+          PR_NUMBER: ${{ github.event.pull_request.number }}
+        run: |
+          echo "Checking commits of PR #${PR_NUMBER} for Claude co-author 
trailers..."
+          flagged=$(gh api "repos/${REPO}/pulls/${PR_NUMBER}/commits" 
--paginate \
+            --jq '.[] | select(.commit.message | 
test("(^|\\n)co-authored-by:\\s*(claude\\s+(opus|sonnet|haiku|fable|mythos|instant|code|[0-9])|[^\\n]*<noreply@anthropic\\.com>)";
 "i")) | .sha')
+
+          if [[ -n "$flagged" ]]; then
+            echo "❌ The following commits contain a Claude co-author trailer:"
+            echo "$flagged"
+            echo ""
+            echo "Commits must not credit Claude as a co-author."
+            echo "Remove the 'Co-authored-by: Claude ...' trailer from the 
commit message(s),"
+            echo "e.g., by amending the commit or rebasing, and force-push the 
branch."
+            exit 1
+          fi
+
+          echo "✅ No Claude co-author trailers found."

Reply via email to