only filter out removed changes from the original PR diff when adding scorecard entries in DR Action report
This commit is contained in:
+15
-2
@@ -125,7 +125,9 @@ async function run(): Promise<void> {
|
|||||||
config.deny_groups
|
config.deny_groups
|
||||||
)
|
)
|
||||||
|
|
||||||
const scorecard = await getScorecardLevels(filteredChanges)
|
// generate informational scorecard entries for all added changes in the PR
|
||||||
|
const scorecardChanges = getScorecardChanges(changes)
|
||||||
|
const scorecard = await getScorecardLevels(scorecardChanges)
|
||||||
|
|
||||||
const minSummary = summary.addSummaryToSummary(
|
const minSummary = summary.addSummaryToSummary(
|
||||||
vulnerableChanges,
|
vulnerableChanges,
|
||||||
@@ -369,7 +371,7 @@ function printScannedDependencies(changes: Changes): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function printDeniedDependencies(
|
function printDeniedDependencies(
|
||||||
changes: Change[],
|
changes: Changes,
|
||||||
config: ConfigurationOptions
|
config: ConfigurationOptions
|
||||||
): void {
|
): void {
|
||||||
core.group('Denied', async () => {
|
core.group('Denied', async () => {
|
||||||
@@ -384,6 +386,17 @@ function printDeniedDependencies(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getScorecardChanges(changes: Changes): Changes {
|
||||||
|
const out: Changes = []
|
||||||
|
for (const change of changes) {
|
||||||
|
if (change.change_type === 'added') {
|
||||||
|
out.push(change)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
async function createScorecardWarnings(
|
async function createScorecardWarnings(
|
||||||
scorecards: Scorecard,
|
scorecards: Scorecard,
|
||||||
config: ConfigurationOptions
|
config: ConfigurationOptions
|
||||||
|
|||||||
Reference in New Issue
Block a user