Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ toolchain go1.26.4

require (
github.com/bradleyfalzon/ghinstallation/v2 v2.19.0
github.com/google/go-github/v85 v85.0.0
github.com/google/go-github/v88 v88.0.0
github.com/k0kubun/pp/v3 v3.5.1
)

require (
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
github.com/google/go-github/v88 v88.0.0 // indirect
github.com/google/go-querystring v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
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/v85 v85.0.0 h1:1+TLFX/akTFXK7o9Z9uAloQGufOn4ySa5DItUM1VWT4=
github.com/google/go-github/v85 v85.0.0/go.mod h1:jYkBnqN+SzR2A2fGKYfbt6DEEQAyxeK0Q2XpPV9ZFsU=
github.com/google/go-github/v88 v88.0.0 h1:dZA9IKkPK1eXZj4ypngnpRj5FwdpTv4whix2PrQMP7M=
github.com/google/go-github/v88 v88.0.0/go.mod h1:rufTDgn2N45wjhukLTyxmvc9nilSp3mr3Rgtt6b1MPw=
github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0=
Expand Down
25 changes: 15 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"time"

"github.com/bradleyfalzon/ghinstallation/v2"
"github.com/google/go-github/v85/github"
"github.com/google/go-github/v88/github"
"github.com/k0kubun/pp/v3"
)

Expand Down Expand Up @@ -102,20 +102,25 @@ func showExport(token string) {
}

func showInstallations(appID int64, key []byte, githubURL string) {
atr, err := ghinstallation.NewAppsTransport(http.DefaultTransport, appID, key)
if err != nil {
log.Fatal(err)
atr, ghierr := ghinstallation.NewAppsTransport(http.DefaultTransport, appID, key)
if ghierr != nil {
log.Fatal(ghierr)
}

var client *github.Client
var (
client *github.Client
err error
)

if githubURL != "" {
atr.BaseURL = githubURL
client, err = github.NewEnterpriseClient(githubURL, githubURL, &http.Client{Transport: atr})
if err != nil {
log.Fatalf("failed creating enterprise client: %v", err)
}
client, err = github.NewClient(github.WithEnterpriseURLs(githubURL, githubURL), github.WithTransport(atr))
} else {
client = github.NewClient(&http.Client{Transport: atr})
client, err = github.NewClient(github.WithTransport(atr))
}

if err != nil {
log.Fatalf("failed creating the client: %v", err)
}

opts := &github.ListOptions{
Expand Down
Loading