diff --git a/lib/util/host-rules.ts b/lib/util/host-rules.ts index 5455079219f45b..176d3e283dc18a 100644 --- a/lib/util/host-rules.ts +++ b/lib/util/host-rules.ts @@ -194,5 +194,5 @@ export function getAll(): HostRule[] { export function clear(): void { logger.debug('Clearing hostRules'); hostRules = []; - sanitize.clearSanitizedSecretsList(); + sanitize.clearRepoSanitizedSecretsList(); } diff --git a/lib/util/sanitize.spec.ts b/lib/util/sanitize.spec.ts index 305eeeeecce0d4..aa64dc782b1b35 100644 --- a/lib/util/sanitize.spec.ts +++ b/lib/util/sanitize.spec.ts @@ -1,13 +1,15 @@ import { addSecretForSanitizing, - clearSanitizedSecretsList, + clearGlobalSanitizedSecretsList, + clearRepoSanitizedSecretsList, sanitize, } from './sanitize'; import { toBase64 } from './string'; describe('util/sanitize', () => { beforeEach(() => { - clearSanitizedSecretsList(); + clearRepoSanitizedSecretsList(); + clearGlobalSanitizedSecretsList(); }); it('sanitizes empty string', () => { diff --git a/lib/util/sanitize.ts b/lib/util/sanitize.ts index 7411aa08db6244..3d7d27c4044349 100644 --- a/lib/util/sanitize.ts +++ b/lib/util/sanitize.ts @@ -58,7 +58,10 @@ export function addSecretForSanitizing( } } -export function clearSanitizedSecretsList(type = 'repo'): void { - const secrets = type === 'repo' ? repoSecrets : globalSecrets; - secrets.clear(); +export function clearRepoSanitizedSecretsList(): void { + repoSecrets.clear(); +} + +export function clearGlobalSanitizedSecretsList(): void { + globalSecrets.clear(); }