diff --git a/src/collectors/contributors.test.ts b/src/collectors/contributors.test.ts index 3969540..e854ffa 100644 --- a/src/collectors/contributors.test.ts +++ b/src/collectors/contributors.test.ts @@ -11,6 +11,7 @@ test('returns unique human committers, sorted, skipping bots', async () => { { author: { login: 'dependabot[bot]', type: 'Bot' }, commit: { author: { name: 'd', date: '' } } }, { author: { login: 'renovate[bot]', type: 'User' }, commit: { author: { name: 'r', date: '' } } }, { author: null, commit: { author: null } }, + { author: { type: 'User' }, commit: { author: { name: 'e', date: '' } } }, ]); const result = await listActiveCommitters(client, { owner: 'acme', name: 'widgets' }, '2026-01-01T00:00:00Z'); diff --git a/src/collectors/contributors.ts b/src/collectors/contributors.ts index 1902b4e..eba867e 100644 --- a/src/collectors/contributors.ts +++ b/src/collectors/contributors.ts @@ -4,7 +4,7 @@ import type { GithubClient } from '../github/GithubClient.ts'; import type { ContributorSlice, RepoRef } from '../types.ts'; interface ListCommitsItem { - author: { login: string; type?: string } | null; + author: { login?: string; type?: string } | null; commit: { author: { name: string; date: string } | null }; } @@ -24,7 +24,7 @@ export function listActiveCommitters( const logins = new Set(); for (const c of commits) { const author = c.author; - if (!author) continue; + if (!author?.login) continue; if (author.type === 'Bot') continue; if (author.login.endsWith('[bot]')) continue; logins.add(author.login);