feat(config): global:safeEnv (#33096)

This commit is contained in:
Rhys Arkins 2024-12-14 08:59:29 +01:00 committed by GitHub
parent 8d00693d56
commit 9d3f7e63b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 17 additions and 1 deletions

View file

@ -52,6 +52,7 @@ const options: RenovateOptions[] = [
subType: 'string',
globalOnly: true,
patternMatch: true,
mergeable: true,
},
{
name: 'detectGlobalManagerConfig',

View 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.',
},
};

View file

@ -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) {

View file

@ -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,

View file

@ -57,6 +57,7 @@ export function parsePreset(input: string): ParsedPreset {
'customManagers',
'default',
'docker',
'global',
'group',
'helpers',
'mergeConfidence',