Automatically collapse the scorecard table
This commit is contained in:
+6
@@ -1314,6 +1314,9 @@ function snapshotWarningRecommendation(config, warnings) {
|
|||||||
function addScorecardToSummary(scorecard, config) {
|
function addScorecardToSummary(scorecard, config) {
|
||||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
||||||
core.summary.addHeading('OpenSSF Scorecard', 2);
|
core.summary.addHeading('OpenSSF Scorecard', 2);
|
||||||
|
if (scorecard.dependencies.length > 10) {
|
||||||
|
core.summary.addRaw(`<details><summary>Scorecard details</summary>`, true);
|
||||||
|
}
|
||||||
core.summary.addRaw(`<table><tr><th>Package</th><th>Version</th><th>Score</th><th>Details</th></tr>`, true);
|
core.summary.addRaw(`<table><tr><th>Package</th><th>Version</th><th>Score</th><th>Details</th></tr>`, true);
|
||||||
for (const dependency of scorecard.dependencies) {
|
for (const dependency of scorecard.dependencies) {
|
||||||
core.debug('Adding scorecard to summary');
|
core.debug('Adding scorecard to summary');
|
||||||
@@ -1347,6 +1350,9 @@ function addScorecardToSummary(scorecard, config) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
core.summary.addRaw(`</table>`);
|
core.summary.addRaw(`</table>`);
|
||||||
|
if (scorecard.dependencies.length > 10) {
|
||||||
|
core.summary.addRaw(`</details>`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exports.addScorecardToSummary = addScorecardToSummary;
|
exports.addScorecardToSummary = addScorecardToSummary;
|
||||||
function addSnapshotWarnings(config, warnings) {
|
function addSnapshotWarnings(config, warnings) {
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -254,6 +254,9 @@ export function addScorecardToSummary(
|
|||||||
config: ConfigurationOptions
|
config: ConfigurationOptions
|
||||||
): void {
|
): void {
|
||||||
core.summary.addHeading('OpenSSF Scorecard', 2)
|
core.summary.addHeading('OpenSSF Scorecard', 2)
|
||||||
|
if (scorecard.dependencies.length > 10) {
|
||||||
|
core.summary.addRaw(`<details><summary>Scorecard details</summary>`, true)
|
||||||
|
}
|
||||||
core.summary.addRaw(
|
core.summary.addRaw(
|
||||||
`<table><tr><th>Package</th><th>Version</th><th>Score</th><th>Details</th></tr>`,
|
`<table><tr><th>Package</th><th>Version</th><th>Score</th><th>Details</th></tr>`,
|
||||||
true
|
true
|
||||||
@@ -303,6 +306,9 @@ export function addScorecardToSummary(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
core.summary.addRaw(`</table>`)
|
core.summary.addRaw(`</table>`)
|
||||||
|
if (scorecard.dependencies.length > 10) {
|
||||||
|
core.summary.addRaw(`</details>`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function addSnapshotWarnings(
|
export function addSnapshotWarnings(
|
||||||
|
|||||||
Reference in New Issue
Block a user