Open nairb774 opened 2 months ago
Seems like it works when downgrading the provider to 6.2.2. It only fails with 6.2.3.
🫡 Same error here, gonna use:
provider "github" {
version = "6.2.2"
}
for now (using Terraform v1.9.4 with it)
A little investigations:
The resource github_ip_ranges
depends on api.github.com/meta via APIMeta struct type of google/go-github.
The error described above, "cannot unmarshal object into Go struct field APIMeta.domains of type []string with data.github_ip_ranges.default", says that field APIMeta.domains
is the cause of error. APIMeta.domains
is defined as map[string][]string
json:"domains,omitempty"
in go-github:
However, observing the actual response from api.github.com/meta, there are artifact_attestations
property under domains
, with schema that deviates from the []string
form -- there are trust_domain
field with string and services
field with array of strings.
Note that the API document of GitHub about this endpoint does not mention about the artifact_attestations
field.
Personally, I feel this is most likely an upstream google/go-github issue. On the other hand, this is likely to involve incompatible changes to the API, which seems like a difficult problem.
I found that the Domains
field in APIMeta
introduced in https://github.com/google/go-github/pull/3121, which included in v62.0.0 release of google/go-github.
As far as I can see, google/go-github's version is upgraded in https://github.com/integrations/terraform-provider-github/pull/2304, which included in v6.2.3 release of terraform-provider-github.
However, if this is happening with an older version, as is also the case at https://github.com/integrations/terraform-provider-github/issues/2357#issuecomment-2304608543 then I don't know what could be causing this.
Now that the upstream issue has been resolved in https://github.com/google/go-github/pull/3249 (cc https://github.com/google/go-github/issues/3248), all we have to do is wait for the next release 👀
Got the same issue, on a mac.
macOS Sonoma 14.5
➜ terraform --version
Terraform v1.9.4
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v5.61.0
+ provider registry.terraform.io/hashicorp/helm v2.14.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.31.0
+ provider registry.terraform.io/hashicorp/random v3.6.2
+ provider registry.terraform.io/integrations/github v6.2.2
+ provider registry.terraform.io/oboukili/argocd v6.1.1
Your version of Terraform is out of date! The latest version
is 1.9.5. You can update by downloading from https://www.terraform.io/downloads.html
Going back to 6.2.2 did the trick.
EDIT
Updated terraform to the latest and it still fail with 6.2.3
still fails with 6.3.0
still fails with 6.3.0
Same for me
The upstream problem is resolved and released in https://github.com/google/go-github/pull/3266 as go-github v65.0.0, so https://github.com/integrations/terraform-provider-github/pull/2359 should fix this issue
v6.3.1 included #2359 and seems to be back to working.
Expected Behavior
The following will provide a list of IP addresses:
Actual Behavior
It fails with the following:
Terraform Version
Terraform v1.9.4 + github provider 6.2.3
Affected Resource(s)
Terraform Configuration Files
Steps to Reproduce
Debug Output
No response
Panic Output
No response
Code of Conduct