Skip to content

Commit 17efa7b

Browse files
author
Abhisek Sanyal
committed
Handle Unsupported Binary Artifacts check
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
1 parent e37ba4f commit 17efa7b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

checks/raw/binary_artifact.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,12 @@ func gradleWrapperValidated(c clients.RepoClient) (bool, error) {
194194
// If validated, check that latest commit has a relevant successful run
195195
runs, err := c.ListSuccessfulWorkflowRuns(gradleWrapperValidatingWorkflowFile)
196196
if err != nil {
197-
return false, fmt.Errorf("failure listing workflow runs: %w", err)
197+
// Do not fail if client returns an unsupported error
198+
if strings.Contains(err.Error(), clients.ErrUnsupportedFeature.Error()) {
199+
return false, nil
200+
} else {
201+
return false, fmt.Errorf("failure listing workflow runs: %w", err)
202+
}
198203
}
199204
commits, err := c.ListCommits()
200205
if err != nil {

0 commit comments

Comments
 (0)