Skip to content

Commit

Permalink
feat(presets): add security group and openssf badge preset (#24553)
Browse files Browse the repository at this point in the history
  • Loading branch information
secustor committed Sep 20, 2023
1 parent 4f9dfb2 commit d1898ed
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/config/presets/index.ts
Expand Up @@ -148,6 +148,7 @@ export function parsePreset(input: string): ParsedPreset {
'regexManagers',
'replacements',
'schedule',
'security',
'workarounds',
];
if (
Expand Down
2 changes: 2 additions & 0 deletions lib/config/presets/internal/index.ts
Expand Up @@ -12,6 +12,7 @@ import * as previewPreset from './preview';
import * as regexManagersPreset from './regex-managers';
import * as replacements from './replacements';
import * as schedulePreset from './schedule';
import * as securityPreset from './security';
import * as workaroundsPreset from './workarounds';

/* eslint sort-keys: ["error", "asc", {caseSensitive: false, natural: true}] */
Expand All @@ -30,6 +31,7 @@ export const groups: Record<string, Record<string, Preset>> = {
regexManagers: regexManagersPreset.presets,
replacements: replacements.presets,
schedule: schedulePreset.presets,
security: securityPreset.presets,
workarounds: workaroundsPreset.presets,
};

Expand Down
24 changes: 24 additions & 0 deletions lib/config/presets/internal/security.ts
@@ -0,0 +1,24 @@
import type { Preset } from '../types';

export const presets: Record<string, Preset> = {
'openssf-scorecard': {
description: 'Show OpenSSF badge on pull requests',
packageRules: [
{
matchSourceUrlPrefixes: ['https://github.com/'],
prBodyDefinitions: {
OpenSSF:
'[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/{{sourceRepo}}/badge)](https://securityscorecards.dev/viewer/?uri=github.com/{{sourceRepo}})',
},
prBodyColumns: [
'Package',
'Type',
'Update',
'Change',
'Pending',
'OpenSSF',
],
},
],
},
};

0 comments on commit d1898ed

Please sign in to comment.