From 884b7abd2d41e3406db0e476c665654522a1603b Mon Sep 17 00:00:00 2001 From: Stefan Petrushevski Date: Wed, 8 Mar 2023 13:02:59 +0100 Subject: [PATCH] updated summary output; create_summary.ts script --- scripts/create_summary.ts | 4 ++++ src/summary.ts | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/create_summary.ts b/scripts/create_summary.ts index 92f4951..ca1affa 100644 --- a/scripts/create_summary.ts +++ b/scripts/create_summary.ts @@ -22,6 +22,10 @@ const defaultConfig: ConfigurationOptions = { allow_ghsas: [], allow_licenses: ['MIT'], deny_licenses: [], + allow_dependencies_licenses: { + npm: ['pkg1'], + pip: ['pkg2'] + }, comment_summary_in_pr: true } diff --git a/src/summary.ts b/src/summary.ts index 05c1fe2..bcc3250 100644 --- a/src/summary.ts +++ b/src/summary.ts @@ -144,13 +144,14 @@ export function addLicensesToSummary( ) } if (config.allow_dependencies_licenses) { - core.summary.addRaw( - "Allow Dependencies (Exceptions)' Licenses: true" - ) + core.summary.addHeading('Allowed licensing exceptions', 3) + for (const [ecosystem, dependencies] of Object.entries( config.allow_dependencies_licenses )) { - core.summary.addRaw(`- ${ecosystem}: ${dependencies.join(', ')}`) + core.summary.addRaw( + `
  • ${ecosystem}: ${dependencies.join(', ')}
  • ` + ) } }