Skip to content

Commit

Permalink
fix: use the appropriate ID when trying to import `github_team_member…
Browse files Browse the repository at this point in the history
…s` objects (integrations#1074)

When importing a `github_team_member`, the import command passes in team ID as the
"Id", not the "team_id" captured in the state for existing resources, and this empty string is
causing the import step to fail when parsing as a number. Should fix integrations#608, as I hit the same error.
  • Loading branch information
brandon-at-wrk authored and kazaker committed Dec 28, 2022
1 parent 743624a commit b6e0602
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions github/resource_github_team_members.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ func resourceGithubTeamMembersRead(d *schema.ResourceData, meta interface{}) err
client := meta.(*Owner).v3client
orgId := meta.(*Owner).id
teamIdString := d.Get("team_id").(string)
if teamIdString == "" && !d.IsNewResource() {
log.Printf("[DEBUG] Importing team with id %q", d.Id())
teamIdString = d.Id()
}

teamId, err := strconv.ParseInt(teamIdString, 10, 64)
if err != nil {
Expand Down

0 comments on commit b6e0602

Please sign in to comment.