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 <zakk@gentoozh.org>
This commit is contained in:
1 parent
b22a87eecc
commit
89662fd5b9
5 files changed
+8
-5
No files matched your search
@@ -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
|
||||
\`\`\`
|
||||
|
||||
+2
-1
@@ -161,7 +161,8 @@ Signed-off-by: A Developer <example@gentoo.org>
|
||||
```
|
||||
|
||||
> [!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:
|
||||
|
||||
|
||||
+2
-1
@@ -133,7 +133,8 @@ Signed-off-by: A Developer <example@gentoo.org>
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> 不得使用 `Co-authored-by:`,否则 CI 会拒绝该提交。
|
||||
> AI 协助不得以 `Co-authored-by:` 标注,否则 CI 会拒绝该提交。
|
||||
> 人类共同作者可正常使用 `Co-authored-by:`。
|
||||
|
||||
以下情况无需声明:
|
||||
|
||||
|
||||
@@ -133,7 +133,8 @@ Signed-off-by: A Developer <example@gentoo.org>
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> 不得使用 `Co-authored-by:`,否則 CI 會拒絕該提交。
|
||||
> AI 協助不得以 `Co-authored-by:` 標註,否則 CI 會拒絕該提交。
|
||||
> 人類共同作者可正常使用 `Co-authored-by:`。
|
||||
|
||||
以下情況無需聲明:
|
||||
|
||||
|
||||
@@ -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"))'
|
||||
Reference in new issue
Block a user