diff --git a/git-hooks/commit-msg.ps1 b/git-hooks/commit-msg.ps1 index 9636f8e..4da51dc 100644 --- a/git-hooks/commit-msg.ps1 +++ b/git-hooks/commit-msg.ps1 @@ -8,6 +8,7 @@ # Co-Authored-By: Claude Opus 4.6 # Co-authored-by: GitHub Copilot # 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 # Generated-by: GitHub Copilot diff --git a/git-hooks/tests/commit-msg.Tests.ps1 b/git-hooks/tests/commit-msg.Tests.ps1 index 4180824..52dd51f 100644 --- a/git-hooks/tests/commit-msg.Tests.ps1 +++ b/git-hooks/tests/commit-msg.Tests.ps1 @@ -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' { @@ -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 `n" $result = Invoke-BashHook $content