Skip to content

Commit eef87e9

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

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
@@ -686,7 +686,7 @@ func resourceGithubRepositoryCreate(ctx context.Context, d *schema.ResourceData,
686686
return diag.FromErr(err)
687687
}
688688

689-
d.SetId(*repo.Name)
689+
d.SetId(repo.GetName())
690690
}
691691
} else if d.Get("fork").(string) == "true" {
692692
// Handle repository forking
@@ -970,7 +970,7 @@ func resourceGithubRepositoryUpdate(ctx context.Context, d *schema.ResourceData,
970970
if err != nil {
971971
return diag.FromErr(err)
972972
}
973-
d.SetId(*repo.Name)
973+
d.SetId(repo.GetName()) // It's possible that `repo.GetName()` is different from `repoName` if the repository is renamed
974974

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

0 commit comments

Comments
 (0)