From 8f60ded7414972a4dfaf4a38ea8735dbceb4ebab Mon Sep 17 00:00:00 2001 From: abhiseksanyal Date: Fri, 14 Oct 2022 18:15:30 +0530 Subject: [PATCH] Handle Unsupported Binary Artifacts check (#4) New functionality added as part of the PR #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 --- checks/raw/binary_artifact.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/checks/raw/binary_artifact.go b/checks/raw/binary_artifact.go index 13f9108eca6..75f61b1f37f 100644 --- a/checks/raw/binary_artifact.go +++ b/checks/raw/binary_artifact.go @@ -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 {