Skip to content

Commit

Permalink
feat: skip protection rules retrieval for protected branches (#4296)
Browse files Browse the repository at this point in the history
  • Loading branch information
slntopp authored Jun 27, 2024
1 parent 7428190 commit a187a80
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions providers/github/resources/github_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,12 @@ func (g *mqlGithubBranch) protectionRules() (*mqlGithubBranchprotection, error)
conn := g.MqlRuntime.Connection.(*connection.GithubConnection)
var err error

// if the branch is not protected, we don't need to fetch the protection rules
if !g.IsProtected.Data {
g.ProtectionRules.State = plugin.StateIsSet | plugin.StateIsNull
return nil, nil
}

if g.RepoName.Error != nil {
return nil, g.RepoName.Error
}
Expand Down

0 comments on commit a187a80

Please sign in to comment.