From 89662fd5b936a6f6ab0a87a2408161bf108f2bc5 Mon Sep 17 00:00:00 2001 From: Zakk Date: Wed, 25 Nov 2026 03:01:14 +1100 Subject: [PATCH] scripts, .github: reject only AI tools in Co-authored-by Rejecting every Co-authored-by line also rejected human co-authors, including the line GitHub adds when a contributor commits a review suggestion. Reject only the identities that AI tools add on their own: anthropic.com, openai.com and cursor.com addresses, Copilot and [bot] accounts. Other AI help still goes in Assisted-by. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Zakk --- .github/workflows/pkgcheck-comment.yml | 2 +- CONTRIBUTING.en.md | 3 ++- CONTRIBUTING.md | 3 ++- CONTRIBUTING.zh-TW.md | 3 ++- scripts/commit-rules.sh | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pkgcheck-comment.yml b/.github/workflows/pkgcheck-comment.yml index aced3f8b0a..cd0ec7980f 100644 --- a/.github/workflows/pkgcheck-comment.yml +++ b/.github/workflows/pkgcheck-comment.yml @@ -139,7 +139,7 @@ jobs: \`\`\` \`git commit -s\` and \`pkgdev commit --signoff\` add it for you. 3. **No merge commits**: update the branch with \`git rebase\`, not \`git merge\` or the Update branch button. - 4. **No \`Co-authored-by\`**: mark AI help with an \`Assisted-by\` line instead. + 4. **No AI in \`Co-authored-by\`**: mark AI help with an \`Assisted-by\` line instead. \`\`\` Assisted-by: Claude:claude-opus-5-5 \`\`\` diff --git a/CONTRIBUTING.en.md b/CONTRIBUTING.en.md index 24bde0ae1e..f2bfe6040d 100644 --- a/CONTRIBUTING.en.md +++ b/CONTRIBUTING.en.md @@ -161,7 +161,8 @@ Signed-off-by: A Developer ``` > [!NOTE] -> Do not add `Co-authored-by:`; CI rejects it. +> Do not credit AI with `Co-authored-by:`; CI rejects it. +> Human co-authors may use `Co-authored-by:`. Disclosure is not required for: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4ee81ec4b6..0fcf0ea683 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -133,7 +133,8 @@ Signed-off-by: A Developer ``` > [!NOTE] -> 不得使用 `Co-authored-by:`,否则 CI 会拒绝该提交。 +> AI 协助不得以 `Co-authored-by:` 标注,否则 CI 会拒绝该提交。 +> 人类共同作者可正常使用 `Co-authored-by:`。 以下情况无需声明: diff --git a/CONTRIBUTING.zh-TW.md b/CONTRIBUTING.zh-TW.md index 920d8db753..142c0e4925 100644 --- a/CONTRIBUTING.zh-TW.md +++ b/CONTRIBUTING.zh-TW.md @@ -133,7 +133,8 @@ Signed-off-by: A Developer ``` > [!NOTE] -> 不得使用 `Co-authored-by:`,否則 CI 會拒絕該提交。 +> AI 協助不得以 `Co-authored-by:` 標註,否則 CI 會拒絕該提交。 +> 人類共同作者可正常使用 `Co-authored-by:`。 以下情況無需聲明: diff --git a/scripts/commit-rules.sh b/scripts/commit-rules.sh index d9e7b26a92..06d24ee396 100755 --- a/scripts/commit-rules.sh +++ b/scripts/commit-rules.sh @@ -8,7 +8,7 @@ gh api "repos/$GITHUB_REPOSITORY/pulls/${1:?pull request number}/commits?per_pag | if (.parents | length) > 1 then ["It is a merge commit"] else [ if ($s | test("^(Revert \"|[^\\s:][^:]*: \\S)")) then empty else "The subject does not start with what it changes" end, if (.commit.message | test("(?m)^Signed-off-by: \\S")) then empty else "It has no `Signed-off-by:` line" end, - if (.commit.message | test("(?im)^Co-authored-by:")) then "It has a `Co-authored-by:` line; mark AI help with `Assisted-by:` instead" else empty end ] + if (.commit.message | test("(?im)^Co-authored-by:.*(anthropic\\.com|openai\\.com|cursor\\.com|copilot|\\[bot\\])")) then "It names an AI tool in a `Co-authored-by:` line; mark AI help with `Assisted-by:` instead" else empty end ] end as $why | select($why | length > 0) | "- `\(.sha[0:12])` `\($s)`\n" + ($why | map(" - " + .) | join("\n"))'