Skip to content

Commit d532cc4

Browse files
Excavator: Update google/go-github to latest version (#557)
1 parent 24efe3e commit d532cc4

11 files changed

Lines changed: 23 additions & 22 deletions

File tree

appconfig/appconfig.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"net/http"
2727
"strings"
2828

29-
"github.com/google/go-github/v86/github"
29+
"github.com/google/go-github/v88/github"
3030
"github.com/rs/zerolog"
3131
)
3232

appconfig/appconfig_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"path/filepath"
2222
"testing"
2323

24-
"github.com/google/go-github/v86/github"
24+
"github.com/google/go-github/v88/github"
2525
)
2626

2727
const (
@@ -166,5 +166,6 @@ func makeTestClient() *github.Client {
166166
} {
167167
rp.AddRule(ExactPathMatcher(route), filepath.Join("testdata", f))
168168
}
169-
return github.NewClient(&http.Client{Transport: rp})
169+
client, _ := github.NewClient(github.WithHTTPClient(&http.Client{Transport: rp}))
170+
return client
170171
}

example/issue_comment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"fmt"
2121
"strings"
2222

23-
"github.com/google/go-github/v86/github"
23+
"github.com/google/go-github/v88/github"
2424
"github.com/palantir/go-githubapp/githubapp"
2525
"github.com/rs/zerolog"
2626
)

githubapp/caching_client_creator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package githubapp
1717
import (
1818
"fmt"
1919

20-
"github.com/google/go-github/v86/github"
20+
"github.com/google/go-github/v88/github"
2121
lru "github.com/hashicorp/golang-lru"
2222
"github.com/shurcooL/githubv4"
2323
"golang.org/x/oauth2"

githubapp/client_creator.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"time"
2525

2626
"github.com/bradleyfalzon/ghinstallation/v2"
27-
"github.com/google/go-github/v86/github"
27+
"github.com/google/go-github/v88/github"
2828
"github.com/gregjones/httpcache"
2929
"github.com/shurcooL/githubv4"
3030
"golang.org/x/oauth2"
@@ -310,15 +310,15 @@ func (c *clientCreator) newClient(base *http.Client, middleware []ClientMiddlewa
310310
middleware,
311311
})
312312

313-
baseURL, err := url.Parse(c.v3BaseURL)
313+
client, err := github.NewClient(
314+
github.WithHTTPClient(base),
315+
github.WithURLs(&c.v3BaseURL, nil),
316+
github.WithUserAgent(makeUserAgent(c.userAgent, details)),
317+
)
314318
if err != nil {
315-
return nil, fmt.Errorf("failed to parse base URL: %q: %w", c.v3BaseURL, err)
319+
return nil, fmt.Errorf("failed to create github client: %w", err)
316320
}
317321

318-
client := github.NewClient(base)
319-
client.BaseURL = baseURL
320-
client.UserAgent = makeUserAgent(c.userAgent, details)
321-
322322
return client, nil
323323
}
324324

githubapp/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package githubapp
1717
import (
1818
"context"
1919

20-
"github.com/google/go-github/v86/github"
20+
"github.com/google/go-github/v88/github"
2121
"github.com/rs/zerolog"
2222
)
2323

githubapp/context_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"encoding/json"
2121
"testing"
2222

23-
"github.com/google/go-github/v86/github"
23+
"github.com/google/go-github/v88/github"
2424
"github.com/rs/zerolog"
2525
)
2626

githubapp/dispatcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"fmt"
2121
"net/http"
2222

23-
"github.com/google/go-github/v86/github"
23+
"github.com/google/go-github/v88/github"
2424
"github.com/rcrowley/go-metrics"
2525
"github.com/rs/zerolog"
2626
)

githubapp/installations.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"fmt"
2020
"net/http"
2121

22-
"github.com/google/go-github/v86/github"
22+
"github.com/google/go-github/v88/github"
2323
)
2424

2525
// Installation is a minimal representation of a GitHub app installation.
@@ -108,14 +108,14 @@ func (i defaultInstallationsService) ListAll(ctx context.Context) ([]Installatio
108108
}
109109

110110
func (i defaultInstallationsService) GetByOwner(ctx context.Context, owner string) (Installation, error) {
111-
installation, _, err := i.Apps.FindOrganizationInstallation(ctx, owner)
111+
installation, _, err := i.Apps.GetOrganizationInstallation(ctx, owner)
112112
if err == nil {
113113
return toInstallation(installation), nil
114114
}
115115

116116
// owner is not an organization, try to find as a user
117117
if isNotFound(err) {
118-
installation, _, err = i.Apps.FindUserInstallation(ctx, owner)
118+
installation, _, err = i.Apps.GetUserInstallation(ctx, owner)
119119
if err == nil {
120120
return toInstallation(installation), nil
121121
}
@@ -128,7 +128,7 @@ func (i defaultInstallationsService) GetByOwner(ctx context.Context, owner strin
128128
}
129129

130130
func (i defaultInstallationsService) GetByRepository(ctx context.Context, owner, repo string) (Installation, error) {
131-
installation, _, err := i.Apps.FindRepositoryInstallation(ctx, owner, repo)
131+
installation, _, err := i.Apps.GetRepositoryInstallation(ctx, owner, repo)
132132
if err == nil {
133133
return toInstallation(installation), nil
134134
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toolchain go1.26.4
77
require (
88
github.com/alexedwards/scs v1.4.1
99
github.com/bradleyfalzon/ghinstallation/v2 v2.18.0
10-
github.com/google/go-github/v86 v86.0.0
10+
github.com/google/go-github/v88 v88.0.0
1111
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
1212
github.com/hashicorp/golang-lru v1.0.2
1313
github.com/patrickmn/go-cache v2.1.0+incompatible

0 commit comments

Comments
 (0)