mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-14 16:46:25 +00:00
79592f848a
This reverts commit 0b287c763d
.
37 lines
966 B
TypeScript
37 lines
966 B
TypeScript
import type { RenovateConfig, RepoAdminConfig } from './types';
|
|
|
|
let adminConfig: RepoAdminConfig = {};
|
|
|
|
// TODO: once admin config work is complete, add a test to make sure this list includes all options with admin=true (#9603)
|
|
const repoAdminOptions = [
|
|
'allowCustomCrateRegistries',
|
|
'allowPostUpgradeCommandTemplating',
|
|
'allowScripts',
|
|
'allowedPostUpgradeCommands',
|
|
'customEnvVariables',
|
|
'dockerChildPrefix',
|
|
'dockerImagePrefix',
|
|
'dockerUser',
|
|
'dryRun',
|
|
'exposeAllEnv',
|
|
'migratePresets',
|
|
'privateKey',
|
|
'localDir',
|
|
'cacheDir',
|
|
];
|
|
|
|
export function setAdminConfig(
|
|
config: RenovateConfig | RepoAdminConfig = {}
|
|
): RenovateConfig {
|
|
adminConfig = {};
|
|
const result = { ...config };
|
|
for (const option of repoAdminOptions) {
|
|
adminConfig[option] = config[option];
|
|
delete result[option]; // eslint-disable-line no-param-reassign
|
|
}
|
|
return result;
|
|
}
|
|
|
|
export function getAdminConfig(): RepoAdminConfig {
|
|
return adminConfig;
|
|
}
|