Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions git-hooks/commit-msg.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# Co-authored-by: GitHub Copilot <noreply@github.com>
# Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
# Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
# Co-authored-by: Amazon Q <q@amazon.com>
# Generated-by: GitHub Copilot

Expand Down
14 changes: 14 additions & 0 deletions git-hooks/tests/commit-msg.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ Describe 'Remove-AITrailers' {
$result | Should -Not -Match 'Co-authored-by'
$result[0] | Should -Be 'Fix bug'
}

It 'removes Co-authored-by: Copilot App with GitHub noreply bot email' {
$lines = @('Fix bug', '', 'Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>')
$result = @(Remove-AITrailers -Lines $lines)
$result | Should -Not -Match 'Co-authored-by'
$result[0] | Should -Be 'Fix bug'
}
}

Context 'Claude / Anthropic Co-authored-by is removed' {
Expand Down Expand Up @@ -418,6 +425,13 @@ Describe 'commit-msg bash hook (end-to-end)' -Skip:($IsWindows -or -not (Get-Com
$result.Trim() | Should -Be 'Fix bug'
}

It 'removes Copilot App trailer with GitHub noreply bot email' {
$content = "Fix bug`n`nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>`n"
$result = Invoke-BashHook $content
$result | Should -Not -Match 'Co-authored-by'
$result.Trim() | Should -Be 'Fix bug'
}

It 'removes Claude trailer by email domain' {
$content = "Fix bug`n`nCo-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>`n"
$result = Invoke-BashHook $content
Expand Down
Loading