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',
|
||||
globalOnly: true,
|
||||
patternMatch: true,
|
||||
mergeable: true,
|
||||
},
|
||||
{
|
||||
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(
|
||||
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.warnings).toHaveLength(0);
|
||||
} catch (err) {
|
||||
|
|
|
@ -3,6 +3,7 @@ import * as configPreset from './config';
|
|||
import * as customManagersPreset from './custom-managers';
|
||||
import * as defaultPreset from './default';
|
||||
import * as dockerPreset from './docker';
|
||||
import * as globalPreset from './global';
|
||||
import * as groupPreset from './group';
|
||||
import * as helpersPreset from './helpers';
|
||||
import * as mergeConfidence from './merge-confidence';
|
||||
|
@ -22,6 +23,7 @@ export const groups: Record<string, Record<string, Preset>> = {
|
|||
customManagers: customManagersPreset.presets,
|
||||
default: defaultPreset.presets,
|
||||
docker: dockerPreset.presets,
|
||||
global: globalPreset.presets,
|
||||
group: groupPreset.presets,
|
||||
helpers: helpersPreset.presets,
|
||||
mergeConfidence: mergeConfidence.presets,
|
||||
|
|
|
@ -57,6 +57,7 @@ export function parsePreset(input: string): ParsedPreset {
|
|||
'customManagers',
|
||||
'default',
|
||||
'docker',
|
||||
'global',
|
||||
'group',
|
||||
'helpers',
|
||||
'mergeConfidence',
|
||||
|
|
Loading…
Reference in a new issue