Skip to content

Commit cd2ff6e

Browse files
authored
Bump google/go-github to v57 (#28514)
1 parent 4ea522f commit cd2ff6e

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

assets/go-licenses.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contrib/backport/backport.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"strings"
1818
"syscall"
1919

20-
"github.com/google/go-github/v53/github"
20+
"github.com/google/go-github/v57/github"
2121
"github.com/urfave/cli/v2"
2222
"gopkg.in/yaml.v3"
2323
)

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ require (
5555
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f
5656
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
5757
github.com/golang-jwt/jwt/v5 v5.0.0
58-
github.com/google/go-github/v53 v53.2.0
58+
github.com/google/go-github/v57 v57.0.0
5959
github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98
6060
github.com/google/uuid v1.3.1
6161
github.com/gorilla/feeds v1.1.1

go.sum

+4-3
Original file line numberDiff line numberDiff line change
@@ -533,10 +533,11 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
533533
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
534534
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
535535
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
536-
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
537536
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
538-
github.com/google/go-github/v53 v53.2.0 h1:wvz3FyF53v4BK+AsnvCmeNhf8AkTaeh2SoYu/XUvTtI=
539-
github.com/google/go-github/v53 v53.2.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao=
537+
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
538+
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
539+
github.com/google/go-github/v57 v57.0.0 h1:L+Y3UPTY8ALM8x+TV0lg+IEBI+upibemtBD8Q9u7zHs=
540+
github.com/google/go-github/v57 v57.0.0/go.mod h1:s0omdnye0hvK/ecLvpsGfJMiRt85PimQh4oygmLIxHw=
540541
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
541542
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
542543
github.com/google/go-tpm v0.9.0 h1:sQF6YqWMi+SCXpsmS3fd21oPy/vSddwZry4JnmltHVk=

services/migrations/error.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package migrations
77
import (
88
"errors"
99

10-
"github.com/google/go-github/v53/github"
10+
"github.com/google/go-github/v57/github"
1111
)
1212

1313
// ErrRepoNotCreated returns the error that repository not created

services/migrations/github.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"code.gitea.io/gitea/modules/proxy"
2121
"code.gitea.io/gitea/modules/structs"
2222

23-
"github.com/google/go-github/v53/github"
23+
"github.com/google/go-github/v57/github"
2424
"golang.org/x/oauth2"
2525
)
2626

@@ -135,7 +135,7 @@ func (g *GithubDownloaderV3) LogString() string {
135135
func (g *GithubDownloaderV3) addClient(client *http.Client, baseURL string) {
136136
githubClient := github.NewClient(client)
137137
if baseURL != "https://github.com" {
138-
githubClient, _ = github.NewEnterpriseClient(baseURL, baseURL, client)
138+
githubClient, _ = github.NewClient(client).WithEnterpriseURLs(baseURL, baseURL)
139139
}
140140
g.clients = append(g.clients, githubClient)
141141
g.rates = append(g.rates, nil)
@@ -168,14 +168,14 @@ func (g *GithubDownloaderV3) waitAndPickClient() {
168168

169169
err := g.RefreshRate()
170170
if err != nil {
171-
log.Error("g.getClient().RateLimits: %s", err)
171+
log.Error("g.getClient().RateLimit.Get: %s", err)
172172
}
173173
}
174174
}
175175

176176
// RefreshRate update the current rate (doesn't count in rate limit)
177177
func (g *GithubDownloaderV3) RefreshRate() error {
178-
rates, _, err := g.getClient().RateLimits(g.ctx)
178+
rates, _, err := g.getClient().RateLimit.Get(g.ctx)
179179
if err != nil {
180180
// if rate limit is not enabled, ignore it
181181
if strings.Contains(err.Error(), "404") {

0 commit comments

Comments
 (0)