mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-15 00:56:26 +00:00
24 lines
705 B
TypeScript
24 lines
705 B
TypeScript
import { RenovateConfig, RepoAdminConfig } from './common';
|
|
|
|
let adminConfig: RepoAdminConfig = {};
|
|
|
|
// TODO: once admin config work is complete, add a test to make sure this list includes all options with admin=true
|
|
export const repoAdminOptions = [
|
|
'allowPostUpgradeCommandTemplating',
|
|
'allowedPostUpgradeCommands',
|
|
'dockerImagePrefix',
|
|
'dockerUser',
|
|
'trustLevel',
|
|
];
|
|
|
|
export function setAdminConfig(config: RenovateConfig = {}): void {
|
|
adminConfig = {};
|
|
for (const option of repoAdminOptions) {
|
|
adminConfig[option] = config[option];
|
|
delete config[option]; // eslint-disable-line no-param-reassign
|
|
}
|
|
}
|
|
|
|
export function getAdminConfig(): RepoAdminConfig {
|
|
return adminConfig;
|
|
}
|