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
|
||||
)
|
||||
|
||||
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(
|
||||
vulnerableChanges,
|
||||
@@ -369,7 +371,7 @@ function printScannedDependencies(changes: Changes): void {
|
||||
}
|
||||
|
||||
function printDeniedDependencies(
|
||||
changes: Change[],
|
||||
changes: Changes,
|
||||
config: ConfigurationOptions
|
||||
): void {
|
||||
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(
|
||||
scorecards: Scorecard,
|
||||
config: ConfigurationOptions
|
||||
|
||||
Reference in New Issue
Block a user