Skip to content

Commit

Permalink
fix: changing the way listOptions is handled so it doesn't error out …
Browse files Browse the repository at this point in the history
…when there are more environments then the max allowed in the request
  • Loading branch information
jj-scoll committed Dec 17, 2024
1 parent 1c11053 commit 43e1e6d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion github/data_source_github_repository_environments.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ func dataSourceGithubRepositoryEnvironmentsRead(d *schema.ResourceData, meta int

results := make([]map[string]interface{}, 0)

var listOptions *github.EnvironmentListOptions
var listOptions = &github.EnvironmentListOptions{
ListOptions: github.ListOptions{},
}
for {
environments, resp, err := client.Repositories.ListEnvironments(context.Background(), orgName, repoName, listOptions)
if err != nil {
Expand Down

0 comments on commit 43e1e6d

Please sign in to comment.