From 17efa7b6beffa5f5cae8253d412cbc26cbeef1b9 Mon Sep 17 00:00:00 2001 From: Abhisek Sanyal Date: Fri, 14 Oct 2022 18:10:09 +0530 Subject: [PATCH] Handle Unsupported Binary Artifacts check 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 6db7b9c3d44..79330a93262 100644 --- a/checks/raw/binary_artifact.go +++ b/checks/raw/binary_artifact.go @@ -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 {