From 517017a7ff05f565193e25e45e85b3b1f657e786 Mon Sep 17 00:00:00 2001 From: Victoria Jeffrey Date: Wed, 13 Sep 2023 14:32:43 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20return=20nil=20when=20no=20branc?= =?UTF-8?q?h=20protection=20found?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- providers/github/resources/github_repo.go | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/providers/github/resources/github_repo.go b/providers/github/resources/github_repo.go index 53da3d16eb..a57f30774a 100644 --- a/providers/github/resources/github_repo.go +++ b/providers/github/resources/github_repo.go @@ -471,22 +471,7 @@ func (g *mqlGithubBranch) protectionRules() (*mqlGithubBranchprotection, error) if err != nil { // NOTE it is possible that the branch does not have any protection rules, therefore we don't return an error if strings.Contains(err.Error(), "Not Found") { - res, err := CreateResource(g.MqlRuntime, "github.branchprotection", map[string]*llx.RawData{ - "id": llx.StringData(repoName + "/" + branchName), - "requiredStatusChecks": llx.MapData(map[string]interface{}{}, types.Any), - "requiredPullRequestReviews": llx.MapData(map[string]interface{}{}, types.Any), - "enforceAdmins": llx.MapData(map[string]interface{}{}, types.Any), - "restrictions": llx.MapData(map[string]interface{}{}, types.Any), - "requireLinearHistory": llx.MapData(map[string]interface{}{}, types.Any), - "allowForcePushes": llx.MapData(map[string]interface{}{}, types.Any), - "allowDeletions": llx.MapData(map[string]interface{}{}, types.Any), - "requiredConversationResolution": llx.MapData(map[string]interface{}{}, types.Any), - "requiredSignatures": llx.BoolData(false), - }) - if err != nil { - return nil, err - } - return res.(*mqlGithubBranchprotection), nil + return nil, nil } // TODO: figure out if the client has the permission to fetch the protection rules return nil, err