integrations / terraform-provider-github

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

[BUG]: Type assertion failure on github_dependabot_organization_secret_repositories.selected_repository_ids #2028

Closed rene-bos closed 10 months ago

rene-bos commented 11 months ago

Expected Behavior

The github_dependabot_organization_secret_repositories to be applied.

Actual Behavior

Panic on theselected_repository_ids field.

Terraform Version

Terraform v1.6.4 on linux_amd64

Affected Resource(s)

Terraform Configuration Files

resource "github_dependabot_organization_secret_repositories" "deployment" {
  depends_on = [module.main_repositories]
  for_each   = { for secret_name in local.deployment_secret_names : secret_name => secret_name }

  secret_name             = each.value
  selected_repository_ids = [for repository_name in local.deployment_repositories : module.main_repositories[repository_name].repository_id]
}

Steps to Reproduce

  1. Add secrets to GitHub using user interface
  2. Run terraform apply to apply the changes
  3. Approve the changes

Debug Output

No response

Panic Output

Stack trace from the terraform-provider-github_v5.42.0 plugin:

panic: interface conversion: interface {} is int, not int64

goroutine 39 [running]:
github.com/integrations/terraform-provider-github/v5/github.resourceGithubDependabotOrganizationSecretRepositoriesCreateOrUpdate(0x1168920?, {0x10c4100?, 0xc0007c4500})
    github.com/integrations/terraform-provider-github/v5/github/resource_github_dependabot_organization_secret_repositories.go:58 +0x2c9
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc0000bb400, 0xc000714820, 0xc0007d03a0, {0x10c4100, 0xc0007c4500})
    github.com/hashicorp/terraform-plugin-sdk@v1.17.2/helper/schema/resource.go:320 +0x637
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc00050d480, 0xc0008498e8, 0x136789d?, 0xf?)
    github.com/hashicorp/terraform-plugin-sdk@v1.17.2/helper/schema/provider.go:294 +0x6a
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc00007dc38, {0xc000274310?, 0x4c3b06?}, 0xc000274310)
    github.com/hashicorp/terraform-plugin-sdk@v1.17.2/internal/helper/plugin/grpc_provider.go:895 +0x7c5
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x1309dc0?, 0xc00007dc38}, {0x17246d0, 0xc000634150}, 0xc0002742a0, 0x0)
    github.com/hashicorp/terraform-plugin-sdk@v1.17.2/internal/tfplugin5/tfplugin5.pb.go:3305 +0x169
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0006d2000, {0x1729e10, 0xc0001e1040}, 0xc000644000, 0xc0006cd200, 0x2041d60, 0x0)
    google.golang.org/grpc@v1.56.3/server.go:1335 +0xde7
google.golang.org/grpc.(*Server).handleStream(0xc0006d2000, {0x1729e10, 0xc0001e1040}, 0xc000644000, 0x0)
    google.golang.org/grpc@v1.56.3/server.go:1712 +0x9e7
google.golang.org/grpc.(*Server).serveStreams.func1.1()
    google.golang.org/grpc@v1.56.3/server.go:947 +0xbb
created by google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 55
    google.golang.org/grpc@v1.56.3/server.go:958 +0x145

Code of Conduct

github-actions[bot] commented 11 months ago

πŸ‘‹ Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! πŸš€