Skip to content

Commit

Permalink
chore: make the OSSF Scorecard analysis more resilient
Browse files Browse the repository at this point in the history
  • Loading branch information
UlisesGascon committed Dec 12, 2024
1 parent 1cdc09f commit 065966b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/workflows/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,17 @@ const upsertOSSFScorecardAnalysis = async (knex) => {
logger.log(`Processing chunk ${i + 1} of ${chunks.length} including ${chunk.length} repositories`)
await Promise.all(chunk.map(async (repo) => {
debug(`Running OSSF Scorecard for repository (${repo.full_name})`)
const scorecard = await ossf.performScorecardAnalysis(repo)
debug(`Validating OSSF Scorecard result for repository (${repo.full_name})`)
validateOSSFResult(scorecard)
debug(`Transforming OSSF Scorecard result for repository (${repo.full_name})`)
const mappedData = ossf.mappers.result(scorecard)
debug(`Upserting OSSF Scorecard result for repository (${repo.full_name})`)
await upsertOSSFScorecard({ ...mappedData, github_repository_id: repo.id })
try {
const scorecard = await ossf.performScorecardAnalysis(repo)
debug(`Validating OSSF Scorecard result for repository (${repo.full_name})`)
validateOSSFResult(scorecard)
debug(`Transforming OSSF Scorecard result for repository (${repo.full_name})`)
const mappedData = ossf.mappers.result(scorecard)
debug(`Upserting OSSF Scorecard result for repository (${repo.full_name})`)
await upsertOSSFScorecard({ ...mappedData, github_repository_id: repo.id })
} catch (error) {
logger.warn(`Error running OSSF Scorecard for repository (${repo.full_name}). Skipping...`)
}
}))
}

Expand Down

0 comments on commit 065966b

Please sign in to comment.