mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-10 22:16:28 +00:00
feat(config): global:safeEnv (#33096)
This commit is contained in:
parent
8d00693d56
commit
9d3f7e63b3
5 changed files with 17 additions and 1 deletions
|
@ -52,6 +52,7 @@ const options: RenovateOptions[] = [
|
||||||
subType: 'string',
|
subType: 'string',
|
||||||
globalOnly: true,
|
globalOnly: true,
|
||||||
patternMatch: true,
|
patternMatch: true,
|
||||||
|
mergeable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'detectGlobalManagerConfig',
|
name: 'detectGlobalManagerConfig',
|
||||||
|
|
11
lib/config/presets/internal/global.ts
Normal file
11
lib/config/presets/internal/global.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import type { Preset } from '../types';
|
||||||
|
|
||||||
|
/* eslint sort-keys: ["error", "asc", {caseSensitive: false, natural: true}] */
|
||||||
|
|
||||||
|
export const presets: Record<string, Preset> = {
|
||||||
|
safeEnv: {
|
||||||
|
allowedEnv: ['GO*'],
|
||||||
|
description:
|
||||||
|
'Hopefully safe environment variables to allow users to configure.',
|
||||||
|
},
|
||||||
|
};
|
|
@ -30,7 +30,8 @@ describe('config/presets/internal/index', () => {
|
||||||
const config = await resolveConfigPresets(
|
const config = await resolveConfigPresets(
|
||||||
massageConfig(presetConfig),
|
massageConfig(presetConfig),
|
||||||
);
|
);
|
||||||
const res = await validateConfig('repo', config, true);
|
const configType = groupName === 'global' ? 'global' : 'repo';
|
||||||
|
const res = await validateConfig(configType, config, true);
|
||||||
expect(res.errors).toHaveLength(0);
|
expect(res.errors).toHaveLength(0);
|
||||||
expect(res.warnings).toHaveLength(0);
|
expect(res.warnings).toHaveLength(0);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
@ -3,6 +3,7 @@ import * as configPreset from './config';
|
||||||
import * as customManagersPreset from './custom-managers';
|
import * as customManagersPreset from './custom-managers';
|
||||||
import * as defaultPreset from './default';
|
import * as defaultPreset from './default';
|
||||||
import * as dockerPreset from './docker';
|
import * as dockerPreset from './docker';
|
||||||
|
import * as globalPreset from './global';
|
||||||
import * as groupPreset from './group';
|
import * as groupPreset from './group';
|
||||||
import * as helpersPreset from './helpers';
|
import * as helpersPreset from './helpers';
|
||||||
import * as mergeConfidence from './merge-confidence';
|
import * as mergeConfidence from './merge-confidence';
|
||||||
|
@ -22,6 +23,7 @@ export const groups: Record<string, Record<string, Preset>> = {
|
||||||
customManagers: customManagersPreset.presets,
|
customManagers: customManagersPreset.presets,
|
||||||
default: defaultPreset.presets,
|
default: defaultPreset.presets,
|
||||||
docker: dockerPreset.presets,
|
docker: dockerPreset.presets,
|
||||||
|
global: globalPreset.presets,
|
||||||
group: groupPreset.presets,
|
group: groupPreset.presets,
|
||||||
helpers: helpersPreset.presets,
|
helpers: helpersPreset.presets,
|
||||||
mergeConfidence: mergeConfidence.presets,
|
mergeConfidence: mergeConfidence.presets,
|
||||||
|
|
|
@ -57,6 +57,7 @@ export function parsePreset(input: string): ParsedPreset {
|
||||||
'customManagers',
|
'customManagers',
|
||||||
'default',
|
'default',
|
||||||
'docker',
|
'docker',
|
||||||
|
'global',
|
||||||
'group',
|
'group',
|
||||||
'helpers',
|
'helpers',
|
||||||
'mergeConfidence',
|
'mergeConfidence',
|
||||||
|
|
Loading…
Reference in a new issue