This commit is contained in:
Rhys Arkins 2020-10-27 22:04:31 +01:00
Родитель 75e23b6ebc
Коммит d121746f8b
2 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -80,7 +80,7 @@ export interface RenovateAdminConfig {
dockerUser?: string;
dryRun?: boolean;
secrets?: any;
secrets?: Record<string, string>;
endpoint?: string;
global?: GlobalConfig;
@ -121,7 +121,7 @@ export type RenovateRepository =
| string
| {
repository: string;
secrets?: any;
secrets?: Record<string, string>;
};
export interface CustomManager {

Просмотреть файл

@ -10,7 +10,7 @@ describe('config/secrets', () => {
expect(validateConfigSecrets({})).toBeUndefined();
});
it('throws if secrets is not an object', () => {
expect(() => validateConfigSecrets({ secrets: 'hello' })).toThrow(
expect(() => validateConfigSecrets({ secrets: 'hello' } as any)).toThrow(
CONFIG_SECRETS_INVALID
);
});
@ -20,14 +20,16 @@ describe('config/secrets', () => {
).toThrow(CONFIG_SECRETS_INVALID);
});
it('throws for non-string secret', () => {
expect(() => validateConfigSecrets({ secrets: { abc: 123 } })).toThrow(
CONFIG_SECRETS_INVALID
);
expect(() =>
validateConfigSecrets({ secrets: { abc: 123 } } as any)
).toThrow(CONFIG_SECRETS_INVALID);
});
it('throws for secrets inside repositories', () => {
expect(() =>
validateConfigSecrets({
repositories: [{ repository: 'abc/def', secrets: { abc: 123 } }],
repositories: [
{ repository: 'abc/def', secrets: { abc: 123 } },
] as any,
})
).toThrow(CONFIG_SECRETS_INVALID);
});