Skip to content

Commit

Permalink
Catch unknown scorecard check.
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Mendoza <[email protected]>
  • Loading branch information
jeffmendoza committed Mar 1, 2024
1 parent 26a969c commit 609be43
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkg/policies/scorecard/scorecard.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,18 @@ func (b Scorecard) Check(ctx context.Context, c *github.Client, owner,
Dlogger: l,
}

res := checksAllChecks[n].Fn(cr)
check, ok := checksAllChecks[n]
if !ok {
log.Warn().
Str("org", owner).
Str("repo", repo).
Str("area", polName).
Str("check", n).
Msg("Unknown scorecard check specified.")
break
}

res := check.Fn(cr)
if res.Error != nil {
// We are not sure that all checks are safe to run inside Allstar, some
// might error, and we don't want to abort a whole org enforcement loop
Expand Down

0 comments on commit 609be43

Please sign in to comment.