Skip to content

Commit 64cb030

Browse files
authored
[BUG] Type mismatch in team_id of emu_group_mapping (#3163)
* Fix `team_id` type to be `TypeInt` instead of `TypeString` Signed-off-by: Timo Sand <[email protected]> * Ensure migration also uses correct type Signed-off-by: Timo Sand <[email protected]> --------- Signed-off-by: Timo Sand <[email protected]>
1 parent 4c95ca9 commit 64cb030

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

github/resource_github_emu_group_mapping.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func resourceGithubEMUGroupMapping() *schema.Resource {
2424
Description: "Manages the mapping of an external group to a GitHub team.",
2525
Schema: map[string]*schema.Schema{
2626
"team_id": {
27-
Type: schema.TypeString,
27+
Type: schema.TypeInt,
2828
Computed: true,
2929
Description: "ID of the GitHub team.",
3030
},
@@ -99,7 +99,7 @@ func resourceGithubEMUGroupMappingCreate(ctx context.Context, d *schema.Resource
9999
return diag.FromErr(err)
100100
}
101101

102-
if err := d.Set("team_id", teamID); err != nil {
102+
if err := d.Set("team_id", int(teamID)); err != nil {
103103
return diag.FromErr(err)
104104
}
105105

@@ -334,7 +334,7 @@ func resourceGithubEMUGroupMappingImport(ctx context.Context, d *schema.Resource
334334
return nil, err
335335
}
336336

337-
if err := d.Set("team_id", teamID); err != nil {
337+
if err := d.Set("team_id", int(teamID)); err != nil {
338338
return nil, err
339339
}
340340

github/resource_github_emu_group_mapping_migration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func resourceGithubEMUGroupMappingStateUpgradeV0(ctx context.Context, rawState m
5656
if err != nil {
5757
return nil, err
5858
}
59-
rawState["team_id"] = teamID
59+
rawState["team_id"] = int(teamID)
6060
resourceID, err := buildID(strconv.FormatInt(teamID, 10), teamSlug, strconv.FormatInt(group.GetGroupID(), 10))
6161
if err != nil {
6262
return nil, err

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ go 1.24.4
44

55
require (
66
github.com/go-jose/go-jose/v3 v3.0.4
7-
github.com/google/go-cmp v0.7.0
87
github.com/google/go-github/v82 v82.0.0
98
github.com/google/uuid v1.6.0
109
github.com/hashicorp/go-cty v1.5.0
@@ -22,6 +21,7 @@ require (
2221
github.com/cloudflare/circl v1.6.1 // indirect
2322
github.com/fatih/color v1.18.0 // indirect
2423
github.com/golang/protobuf v1.5.4 // indirect
24+
github.com/google/go-cmp v0.7.0 // indirect
2525
github.com/google/go-querystring v1.2.0 // indirect
2626
github.com/hashicorp/errwrap v1.0.0 // indirect
2727
github.com/hashicorp/go-checkpoint v0.5.0 // indirect

0 commit comments

Comments
 (0)