Skip to content

Commit f434954

Browse files
committed
Use repo.GetName() instead of *repo.Name
Signed-off-by: Timo Sand <[email protected]>
1 parent 2df4f33 commit f434954

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

github/resource_github_repository.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ func resourceGithubRepositoryCreate(ctx context.Context, d *schema.ResourceData,
683683
return diag.FromErr(err)
684684
}
685685

686-
d.SetId(*repo.Name)
686+
d.SetId(repo.GetName())
687687
}
688688
} else if d.Get("fork").(string) == "true" {
689689
// Handle repository forking
@@ -963,7 +963,7 @@ func resourceGithubRepositoryUpdate(ctx context.Context, d *schema.ResourceData,
963963
if err != nil {
964964
return diag.FromErr(err)
965965
}
966-
d.SetId(*repo.Name)
966+
d.SetId(repo.GetName()) // It's possible that `repo.GetName()` is different from `repoName` if the repository is renamed
967967

968968
if d.HasChange("pages") && !d.IsNewResource() {
969969
opts := expandPagesUpdate(d.Get("pages").([]any))

0 commit comments

Comments
 (0)