diff --git a/lib/modules/platform/github/index.spec.ts b/lib/modules/platform/github/index.spec.ts index 4bba33b7f63fa989309a4fcc4381eaa287d9de66..8d945469f3b654e5e487e75d0a26751f1327f7a8 100644 --- a/lib/modules/platform/github/index.spec.ts +++ b/lib/modules/platform/github/index.spec.ts @@ -176,6 +176,7 @@ describe('modules/platform/github/index', () => { { full_name: 'c/d', }, + null, ]); const repos = await github.getRepos(); expect(repos).toMatchSnapshot(); @@ -200,6 +201,7 @@ describe('modules/platform/github/index', () => { { full_name: 'c/d', }, + null, ], }); diff --git a/lib/modules/platform/github/index.ts b/lib/modules/platform/github/index.ts index 12e7ffbaa18c5a3edfa8d1f4e25baae4085142bc..ddc6384dc80f816a432a2d54a4413d8fbb597980 100644 --- a/lib/modules/platform/github/index.ts +++ b/lib/modules/platform/github/index.ts @@ -180,13 +180,15 @@ export async function getRepos(): Promise<string[]> { paginationField: 'repositories', paginate: 'all', }); - return res.body.repositories.map((repo) => repo.full_name); + return res.body.repositories + .filter(is.nonEmptyObject) + .map((repo) => repo.full_name); } else { const res = await githubApi.getJson<{ full_name: string }[]>( `user/repos?per_page=100`, { paginate: 'all' } ); - return res.body.map((repo) => repo.full_name); + return res.body.filter(is.nonEmptyObject).map((repo) => repo.full_name); } } catch (err) /* istanbul ignore next */ { logger.error({ err }, `GitHub getRepos error`);