From 4d16a2483228972804119c6d39f4877de093d9c5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 13:43:25 +0000 Subject: [PATCH 1/2] Update module github.com/google/go-github/v60 to v89 --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index fcdf65f..606f533 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.25.0 require ( github.com/goccy/go-yaml v1.19.2 - github.com/google/go-github/v60 v60.0.0 + github.com/google/go-github/v89 v89.0.0 github.com/google/go-github/v89 v89.0.0 golang.org/x/oauth2 v0.36.0 ) From c27cb60bed3c98cddf4c7bab8fbaca81399fce37 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Jul 2026 13:48:59 +0000 Subject: [PATCH 2/2] Fix go-github v89 API usage and imports --- go.mod | 1 - go.sum | 12 +++--------- internal/github/client.go | 8 ++++++-- internal/github/pr.go | 15 ++++++++------- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 606f533..552ee0e 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.25.0 require ( github.com/goccy/go-yaml v1.19.2 github.com/google/go-github/v89 v89.0.0 - github.com/google/go-github/v89 v89.0.0 golang.org/x/oauth2 v0.36.0 ) diff --git a/go.sum b/go.sum index c809ede..1198526 100644 --- a/go.sum +++ b/go.sum @@ -1,17 +1,11 @@ github.com/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM= github.com/goccy/go-yaml v1.19.2/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v60 v60.0.0 h1:oLG98PsLauFvvu4D/YPxq374jhSxFYdzQGNCyONLfn8= -github.com/google/go-github/v60 v60.0.0/go.mod h1:ByhX2dP9XT9o/ll2yXAu2VD8l5eNVg8hD4Cr0S/LmQk= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/go-github/v89 v89.0.0 h1:35bEK5XoEcF3PZrlVbl9XN63f5BcJRA/UGkxeC9xPg0= github.com/google/go-github/v89 v89.0.0/go.mod h1:QLcbU0ipeAqQuR5KSg8c2lql4Qk1EwJ2dWz/0rP4Nho= -github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0= github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU= -golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= -golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/github/client.go b/internal/github/client.go index 907e08e..47d339b 100644 --- a/internal/github/client.go +++ b/internal/github/client.go @@ -20,7 +20,7 @@ import ( "fmt" "os" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v89/github" "golang.org/x/oauth2" ) @@ -69,9 +69,13 @@ func NewClient(ctx context.Context, token string, opts ...ClientOption) (*Client &oauth2.Token{AccessToken: token}, ) tc := oauth2.NewClient(ctx, ts) + ghClient, err := github.NewClient(github.WithHTTPClient(tc)) + if err != nil { + return nil, fmt.Errorf("creating github client: %w", err) + } c := &Client{ - client: github.NewClient(tc), + client: ghClient, fileReader: &osFileReader{}, } diff --git a/internal/github/pr.go b/internal/github/pr.go index e01fd08..8e83417 100644 --- a/internal/github/pr.go +++ b/internal/github/pr.go @@ -18,7 +18,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v60/github" + "github.com/google/go-github/v89/github" ) // CreateReleasePR creates a new branch with the modified files and opens a PR. @@ -34,9 +34,9 @@ func (c *Client) CreateReleasePR(ctx context.Context, req PRRequest) (*PRResult, } // Create the new branch - newRef := &github.Reference{ - Ref: github.String("refs/heads/" + req.HeadBranch), - Object: &github.GitObject{SHA: baseRef.Object.SHA}, + newRef := github.CreateRef{ + Ref: "refs/heads/" + req.HeadBranch, + SHA: baseRef.GetObject().GetSHA(), } _, _, err = c.client.Git.CreateRef(ctx, req.Owner, req.Repo, newRef) @@ -133,7 +133,7 @@ func (c *Client) commitFiles(ctx context.Context, owner, repo, branch string, fi // Create the commit commit, _, err := c.client.Git.CreateCommit(ctx, owner, repo, - &github.Commit{ + github.Commit{ Message: github.String(message), Tree: tree, Parents: []*github.Commit{baseCommit}, @@ -145,8 +145,9 @@ func (c *Client) commitFiles(ctx context.Context, owner, repo, branch string, fi } // Update the branch reference to point to the new commit - ref.Object.SHA = commit.SHA - _, _, err = c.client.Git.UpdateRef(ctx, owner, repo, ref, false) + _, _, err = c.client.Git.UpdateRef(ctx, owner, repo, ref.GetRef(), github.UpdateRef{ + SHA: commit.GetSHA(), + }) if err != nil { return fmt.Errorf("updating ref: %w", err) }