Skip to content

AI-native design editor. Open-source Figma alternative.

fix(ci): recognize bare AI co-author addresses

Danila Poyarkov3b4fdeb62319
diff --git a/tools/ci/src/commit-attribution.ts b/tools/ci/src/commit-attribution.ts
index c137847bd..340553fa6 100644
--- a/tools/ci/src/commit-attribution.ts
+++ b/tools/ci/src/commit-attribution.ts
@@ -22,8 +22,10 @@ export function hasAICoauthor(message: string): boolean {
encoding: 'utf8'
})
return trailers.split('\n').some((line) => {
- const email = /^co-authored-by:\s*.*<([^<>]+)>\s*$/i.exec(line)?.[1]?.trim().toLowerCase()
- return email !== undefined && (AI_COAUTHOR_EMAILS.has(email) || AI_GITHUB_EMAIL.test(email))
+ const value = /^co-authored-by:\s*(.*)$/i.exec(line)?.[1]?.trim()
+ if (!value) return false
+ const email = (/<([^<>]+)>$/.exec(value)?.[1] ?? value).trim().toLowerCase()
+ return AI_COAUTHOR_EMAILS.has(email) || AI_GITHUB_EMAIL.test(email)
})
}
diff --git a/tools/ci/tests/commit-messages.test.ts b/tools/ci/tests/commit-messages.test.ts
index b33df173c..75f910c21 100644
--- a/tools/ci/tests/commit-messages.test.ts
+++ b/tools/ci/tests/commit-messages.test.ts
@@ -39,6 +39,7 @@ test.each([
test.each([
'fix: document Claude Code and OpenAI integration',
'fix: preserve credits\n\nCo-authored-by: Claude Martin <[email protected]>',
+ 'fix: preserve credits\n\nCo-authored-by: [email protected]',
'fix: preserve credits\n\nCo-authored-by: Claude <[email protected]>',
'fix: preserve credits\n\nCo-authored-by: Codex <[email protected]>',
'fix: preserve credits\n\nCo-authored-by: Human Contributor <[email protected]>',
@@ -49,6 +50,8 @@ test.each([
test.each([
'Claude Sonnet 5 <[email protected]>',
'Codex <[email protected]>',
'Cursor <[email protected]>',
'Gemini CLI <[email protected]>',
@@ -84,6 +87,15 @@ test.each([
expect(result.output).toContain('Preserve human co-author credits')
})
+test.each(['fix: update', 'Release v0.14.0'])(
+ 'rejects bare assistant email trailers: %s',
+ async (subject) => {
+ const result = await lint(`${subject}\n\nCo-authored-by: [email protected]`)
+ expect(result.code).not.toBe(0)
+ expect(result.output).toContain('no-ai-coauthors')
+ }
+)
+
test.each([
['Fixed stuff', 'type-empty'],
['feature: add tools', 'type-enum'],