diff --git a/lib/modules/manager/pre-commit/extract.spec.ts b/lib/modules/manager/pre-commit/extract.spec.ts index d7278ae76028142121f08b9371b619f9b9a3d7cb..1939f50b1cb11cc88ddd97b504b73ae523ca2f70 100644 --- a/lib/modules/manager/pre-commit/extract.spec.ts +++ b/lib/modules/manager/pre-commit/extract.spec.ts @@ -95,7 +95,12 @@ describe('modules/manager/pre-commit/extract', () => { }); it('can handle private git repos', () => { - hostRules.find.mockReturnValue({ token: 'value' }); + // url only + hostRules.find.mockReturnValueOnce({ token: 'value1' }); + // hostType=github + hostRules.find.mockReturnValueOnce({}); + // hostType=gitlab + hostRules.find.mockReturnValueOnce({ token: 'value' }); const result = extractPackageFile(enterpriseGitPrecommitConfig, filename); expect(result).toEqual({ deps: [ diff --git a/lib/modules/manager/pre-commit/extract.ts b/lib/modules/manager/pre-commit/extract.ts index a97a248499ff0ba36bd37600d2b2139a3ae96b10..fa0ecb6a6162afad0b48a5366f71c8101949ef54 100644 --- a/lib/modules/manager/pre-commit/extract.ts +++ b/lib/modules/manager/pre-commit/extract.ts @@ -50,7 +50,6 @@ function determineDatasource( return { skipReason: 'unknown-registry', registryUrls: [hostname] }; } for (const [hostType, sourceId] of [ - ['gitea', GitlabTagsDatasource.id], ['github', GithubTagsDatasource.id], ['gitlab', GitlabTagsDatasource.id], ]) { @@ -64,7 +63,7 @@ function determineDatasource( } logger.debug( { repository, registry: hostUrl }, - 'Provided hostname did not match any of the hostRules of hostType gitea,github nor gitlab' + 'Provided hostname did not match any of the hostRules of hostType github nor gitlab' ); return { skipReason: 'unknown-registry', registryUrls: [hostname] }; }