integrations / terraform-provider-github

Terraform GitHub provider
https://www.terraform.io/docs/providers/github/
MIT License
879 stars 719 forks source link

[BUG]: `github_repositories` data source `query` parameter behaviour is inconsistent with documentation and usage via GitHub UI #2200

Open connorhsm opened 5 months ago

connorhsm commented 5 months ago

Expected Behavior

Pasting this query into an organisation repository search org:my-org fork:true will return only repositories that are forks.

I would expect Terraform to behave the same as the GitHub UI.

data "github_repositories" "all" {
  query = "org:my-org fork:true"
}

output "length" {
  value = length(data.github_repositories.all.names)
}

Output = Total count of repos within the organisation that are forks. e.g. 10

Actual Behavior

Terraform instead returns all repositories, including forks of the organisation. Omitting fork:true causes the data source to return all repositories that are not forks.

data "github_repositories" "all" {
  query = "org:my-org fork:true"
}

output "length" {
  value = length(data.github_repositories.all.names)
}

Output = Total count of repos within the organisation. e.g. 100

Terraform Version

1.7.5

Affected Resource(s)

Terraform Configuration Files

No response

Steps to Reproduce

$ terraform plan

Debug Output

No response

Panic Output

No response

Code of Conduct