Skip to content

Commit

Permalink
Merge pull request #783 from actions/elireisman/all-changes-to-scorecard
Browse files Browse the repository at this point in the history
Include all added dependencies in scorecard entries
  • Loading branch information
elireisman authored Jun 7, 2024
2 parents 8285e75 + 1e5b2e6 commit df5d74f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
13 changes: 12 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

17 changes: 15 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -369,7 +371,7 @@ function printScannedDependencies(changes: Changes): void {
}

function printDeniedDependencies(
changes: Change[],
changes: Changes,
config: ConfigurationOptions
): void {
core.group('Denied', async () => {
Expand All @@ -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
Expand Down

0 comments on commit df5d74f

Please sign in to comment.