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