Skip to content

Commit 3a82a12

Browse files
committed
Use new CreateRef API
1 parent 808de22 commit 3a82a12

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

github/resource_github_branch.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"net/http"
88
"strings"
99

10-
"github.com/google/go-github/v68/github"
10+
"github.com/google/go-github/v77/github"
1111
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1212
)
1313

@@ -97,9 +97,9 @@ func resourceGithubBranchCreate(d *schema.ResourceData, meta interface{}) error
9797
}
9898
sourceBranchSHA := d.Get("source_sha").(string)
9999

100-
_, _, err := client.Git.CreateRef(ctx, orgName, repoName, &github.Reference{
101-
Ref: &branchRefName,
102-
Object: &github.GitObject{SHA: &sourceBranchSHA},
100+
_, _, err := client.Git.CreateRef(ctx, orgName, repoName, github.CreateRef{
101+
Ref: branchRefName,
102+
SHA: sourceBranchSHA,
103103
})
104104
// If the branch already exists, rather than erroring out just continue on to importing the branch
105105
// This avoids the case where a repo with gitignore_template and branch are being created at the same time crashing terraform

0 commit comments

Comments
 (0)