Skip to content

Commit

Permalink
Handle Unsupported Binary Artifacts check
Browse files Browse the repository at this point in the history
New functionality added as part of the PR ossf#2039 is not supported for
local repositories. When this code path is hit, it will check if it is
an unsupported error and not fail the Binary Artifacts check.
Fallback to existing behavior for any other type of errors
  • Loading branch information
Abhisek Sanyal committed Oct 14, 2022
1 parent e37ba4f commit 17efa7b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion checks/raw/binary_artifact.go
Expand Up @@ -194,7 +194,12 @@ func gradleWrapperValidated(c clients.RepoClient) (bool, error) {
// If validated, check that latest commit has a relevant successful run
runs, err := c.ListSuccessfulWorkflowRuns(gradleWrapperValidatingWorkflowFile)
if err != nil {
return false, fmt.Errorf("failure listing workflow runs: %w", err)
// Do not fail if client returns an unsupported error
if strings.Contains(err.Error(), clients.ErrUnsupportedFeature.Error()) {
return false, nil
} else {
return false, fmt.Errorf("failure listing workflow runs: %w", err)
}
}
commits, err := c.ListCommits()
if err != nil {
Expand Down

0 comments on commit 17efa7b

Please sign in to comment.