diff --git a/lib/workers/global/autodiscover.spec.ts b/lib/workers/global/autodiscover.spec.ts index 8889ec09afa0a444a8d75a6da2abe4c6ddea9006..6f20520b1383055a0bf479e29bc0c41365802418 100644 --- a/lib/workers/global/autodiscover.spec.ts +++ b/lib/workers/global/autodiscover.spec.ts @@ -77,6 +77,20 @@ describe('workers/global/autodiscover', () => { expect(res.repositories).toEqual(['project/repo']); }); + it('filters autodiscovered dot repos', async () => { + config.autodiscover = true; + config.autodiscoverFilter = ['project/*']; + config.platform = 'github'; + hostRules.find = jest.fn(() => ({ + token: 'abc', + })); + ghApi.getRepos = jest.fn(() => + Promise.resolve(['project/repo', 'project/.github']) + ); + const res = await autodiscoverRepositories(config); + expect(res.repositories).toEqual(['project/repo', 'project/.github']); + }); + it('filters autodiscovered github repos but nothing matches', async () => { config.autodiscover = true; config.autodiscoverFilter = ['project/re*']; diff --git a/lib/workers/global/autodiscover.ts b/lib/workers/global/autodiscover.ts index df8b672bf79dfa9e4352a75e3ada3311e505e99e..92f6f653a9fbf6dc895256975c1c4eca25a27a42 100644 --- a/lib/workers/global/autodiscover.ts +++ b/lib/workers/global/autodiscover.ts @@ -107,7 +107,7 @@ export function applyFilters(repos: string[], filters: string[]): string[] { } res = repos.filter(autodiscoveryPred); } else { - res = repos.filter(minimatch.filter(filter, { nocase: true })); + res = repos.filter(minimatch.filter(filter, { dot: true, nocase: true })); } for (const repository of res) { matched.add(repository);