feat: workarounds presets (#7695)

This commit is contained in:
Rhys Arkins 2020-11-11 14:06:46 +01:00 committed by GitHub
parent 5118ae9956
commit e0bf8814ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 0 deletions

View file

@ -95,6 +95,7 @@ export function parsePreset(input: string): ParsedPreset {
'packages', 'packages',
'preview', 'preview',
'schedule', 'schedule',
'workarounds',
]; ];
if ( if (
presetsPackages.some((presetPackage) => str.startsWith(`${presetPackage}:`)) presetsPackages.some((presetPackage) => str.startsWith(`${presetPackage}:`))

View file

@ -18,6 +18,7 @@ export const presets: Record<string, Preset> = {
'group:monorepos', 'group:monorepos',
'group:recommended', 'group:recommended',
'helpers:disableTypesNodeMajor', 'helpers:disableTypesNodeMajor',
'workarounds:all',
], ],
}, },
'base-js': { 'base-js': {

View file

@ -8,6 +8,7 @@ import * as monorepoPreset from './monorepo';
import * as packagesPreset from './packages'; import * as packagesPreset from './packages';
import * as previewPreset from './preview'; import * as previewPreset from './preview';
import * as schedulePreset from './schedule'; import * as schedulePreset from './schedule';
import * as workaroundsPreset from './workarounds';
export const groups: Record<string, Record<string, Preset>> = { export const groups: Record<string, Record<string, Preset>> = {
config: configPreset.presets, config: configPreset.presets,
@ -19,6 +20,7 @@ export const groups: Record<string, Record<string, Preset>> = {
packages: packagesPreset.presets, packages: packagesPreset.presets,
preview: previewPreset.presets, preview: previewPreset.presets,
schedule: schedulePreset.presets, schedule: schedulePreset.presets,
workarounds: workaroundsPreset.presets,
}; };
export function getPreset({ export function getPreset({

View file

@ -0,0 +1,20 @@
import { Preset } from '../common';
export const presets: Record<string, Preset> = {
all: {
description: [
'A collection of workarounds for known problems with packages',
],
extends: ['workarounds:unstableV2SetupNodeActions'],
},
unstableV2SetupNodeActions: {
description: 'Ignore wrongly tagged actions/setup-node v2 releases',
packageRules: [
{
datasources: ['github-tags', 'github-releases'],
packageNames: ['actions/setup-node'],
allowedVersions: '<2.1.1 || > 2.1.1',
},
],
},
};