Skip to content

Commit db1c41c

Browse files
authored
Fix resourceGithubDependabotOrganizationSecretCreateOrUpdate (#1759)
Fixes a regression used when trying to create/update a dependabot organization secret. List is an `int` so cannot be cast to a different type. We therefore double convert it. There was a regression introduced by version 5.27. This happened as the go-github client moved over to using int64 as ids in v53.0.0 ```hcl terraform { required_providers { github = { source = "integrations/github" version = "5.27.0" } } } provider "github" { owner = var.owner } variable "owner" { type = string } resource "github_repository" "example" { name = "example" description = "My awesome codebase" visibility = "public" } resource "github_dependabot_organization_secret" "example" { secret_name = "example" visibility = "selected" plaintext_value = "anything" selected_repository_ids = [ github_repository.example.repo_id, ] } ```
1 parent c9a7c1a commit db1c41c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

github/resource_github_dependabot_organization_secret.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import (
44
"context"
55
"encoding/base64"
66
"fmt"
7+
"log"
8+
"net/http"
9+
710
"github.com/google/go-github/v53/github"
811
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
912
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
10-
"log"
11-
"net/http"
1213
)
1314

1415
func resourceGithubDependabotOrganizationSecret() *schema.Resource {
@@ -101,7 +102,7 @@ func resourceGithubDependabotOrganizationSecretCreateOrUpdate(d *schema.Resource
101102
ids := selectedRepositories.(*schema.Set).List()
102103

103104
for _, id := range ids {
104-
selectedRepositoryIDs = append(selectedRepositoryIDs, id.(int64))
105+
selectedRepositoryIDs = append(selectedRepositoryIDs, int64(id.(int)))
105106
}
106107
}
107108

0 commit comments

Comments
 (0)