secrets typing
This commit is contained in:
Родитель
75e23b6ebc
Коммит
d121746f8b
|
@ -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);
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче