diff --git a/internal/collectors/github/repository_collector.go b/internal/collectors/github/repository_collector.go index 21a292db..0d63c242 100644 --- a/internal/collectors/github/repository_collector.go +++ b/internal/collectors/github/repository_collector.go @@ -360,7 +360,7 @@ func (rc *repositoryCollector) withVulnerabilityAlerts(repo ghcollected.Reposito } func (rc *repositoryCollector) withRepoCollaborators(repo ghcollected.Repository, org string) ghcollected.Repository { - users, _, err := rc.Client.Client().Repositories.ListCollaborators(rc.Context, org, repo.Repository.Name, &github.ListCollaboratorsOptions{}) + users, err := pagination.New[*github.User](rc.Client.Client().Repositories.ListCollaborators, &github.ListCollaboratorsOptions{}).Sync(rc.Context, org, repo.Repository.Name) if err != nil { perm := collectors.NewMissingPermission(permissions.RepoAdmin, collectors.FullRepoName(org, repo.Repository.Name), "Cannot read repository collaborators", namespace.Repository) @@ -368,7 +368,7 @@ func (rc *repositoryCollector) withRepoCollaborators(repo ghcollected.Repository return repo } - repo.Collaborators = users + repo.Collaborators = users.Collected return repo } diff --git a/policies/github/repository.rego b/policies/github/repository.rego index cf9bef84..535ce039 100644 --- a/policies/github/repository.rego +++ b/policies/github/repository.rego @@ -151,7 +151,7 @@ missing_default_branch_protection_deletion := false { missing_default_branch_protection_deletion := false { some index rule := input.rules_set[index] - rule.type == "deletions" + rule.type == "deletion" } # METADATA