Skip to content

Commit

Permalink
Handle Unsupported Binary Artifacts check (#4)
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
abhiseksanyal committed Aug 22, 2023
1 parent 63b5110 commit 8f60ded
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion checks/raw/binary_artifact.go
Expand Up @@ -205,7 +205,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 8f60ded

Please sign in to comment.