Update copy and styling

This commit is contained in:
Claire Song
2025-08-14 17:44:34 +00:00
parent 6e80be31cd
commit 659a1e1bd0
4 changed files with 7 additions and 9 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ test('adds deprecation warning for deny-licenses option', () => {
const text = core.summary.stringify() const text = core.summary.stringify()
expect(text).toContain( expect(text).toContain(
'⚠️ The <em>deny-licenses</em> option is deprecated and will be removed in a future version, use <em>allow-licenses</em> instead.' '⚠️ <strong>Deprecation Warning</strong>: The <em>deny-licenses</em> option is deprecated and will be removed in a future version, use <em>allow-licenses</em> instead.'
) )
}) })
Generated Vendored
+2 -3
View File
@@ -1600,12 +1600,12 @@ const MAX_SCANNED_FILES_BYTES = 1048576;
// returns the DR summary string, ready to be posted as a PR comment if the // returns the DR summary string, ready to be posted as a PR comment if the
// final DR report is too large // final DR report is too large
function addSummaryToSummary(vulnerableChanges, invalidLicenseChanges, deniedChanges, scorecard, config) { function addSummaryToSummary(vulnerableChanges, invalidLicenseChanges, deniedChanges, scorecard, config) {
addDenyListsDeprecationWarningToSummary();
const out = []; const out = [];
const scorecardWarnings = countScorecardWarnings(scorecard, config); const scorecardWarnings = countScorecardWarnings(scorecard, config);
const licenseIssues = countLicenseIssues(invalidLicenseChanges); const licenseIssues = countLicenseIssues(invalidLicenseChanges);
core.summary.addHeading('Dependency Review', 1); core.summary.addHeading('Dependency Review', 1);
out.push('# Dependency Review'); out.push('# Dependency Review');
addDenyListsDeprecationWarningToSummary();
if (vulnerableChanges.length === 0 && if (vulnerableChanges.length === 0 &&
licenseIssues === 0 && licenseIssues === 0 &&
deniedChanges.length === 0 && deniedChanges.length === 0 &&
@@ -1662,8 +1662,7 @@ function addSummaryToSummary(vulnerableChanges, invalidLicenseChanges, deniedCha
return out.join('\n'); return out.join('\n');
} }
function addDenyListsDeprecationWarningToSummary() { function addDenyListsDeprecationWarningToSummary() {
core.summary.addRaw(`${icons.warning} The <em>deny-licenses</em> option is deprecated and will be removed in a future version, use <em>allow-licenses</em> instead.<br>`, true); core.summary.addRaw(`${icons.warning} <strong>Deprecation Warning</strong>: The <em>deny-licenses</em> option is deprecated and will be removed in a future version, use <em>allow-licenses</em> instead.`, true);
core.summary.addEOL();
} }
function countScorecardWarnings(scorecard, config) { function countScorecardWarnings(scorecard, config) {
return scorecard.dependencies.reduce((total, dependency) => { return scorecard.dependencies.reduce((total, dependency) => {
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -4
View File
@@ -22,6 +22,8 @@ export function addSummaryToSummary(
scorecard: Scorecard, scorecard: Scorecard,
config: ConfigurationOptions config: ConfigurationOptions
): string { ): string {
addDenyListsDeprecationWarningToSummary()
const out: string[] = [] const out: string[] = []
const scorecardWarnings = countScorecardWarnings(scorecard, config) const scorecardWarnings = countScorecardWarnings(scorecard, config)
@@ -30,8 +32,6 @@ export function addSummaryToSummary(
core.summary.addHeading('Dependency Review', 1) core.summary.addHeading('Dependency Review', 1)
out.push('# Dependency Review') out.push('# Dependency Review')
addDenyListsDeprecationWarningToSummary()
if ( if (
vulnerableChanges.length === 0 && vulnerableChanges.length === 0 &&
licenseIssues === 0 && licenseIssues === 0 &&
@@ -110,10 +110,9 @@ export function addSummaryToSummary(
function addDenyListsDeprecationWarningToSummary(): void { function addDenyListsDeprecationWarningToSummary(): void {
core.summary.addRaw( core.summary.addRaw(
`${icons.warning} The <em>deny-licenses</em> option is deprecated and will be removed in a future version, use <em>allow-licenses</em> instead.<br>`, `${icons.warning} <strong>Deprecation Warning</strong>: The <em>deny-licenses</em> option is deprecated and will be removed in a future version, use <em>allow-licenses</em> instead.`,
true true
) )
core.summary.addEOL()
} }
function countScorecardWarnings( function countScorecardWarnings(