diff --git a/pkg/github/githubutil.go b/pkg/github/githubutil.go index 2d72b67a..8d830fd7 100644 --- a/pkg/github/githubutil.go +++ b/pkg/github/githubutil.go @@ -231,7 +231,11 @@ func GetGHRepoService() GHRepoService { gh = github.NewClient(oauth2.NewClient(context.Background(), oauth2.StaticTokenSource( &oauth2.Token{AccessToken: os.Getenv("GITHUB_TOKEN")}, ))) - } else { + if _, err := ListReleases(flyte, gh.Repositories); err != nil { + gh = nil + } + } + if gh == nil { gh = github.NewClient(&http.Client{}) } return gh.Repositories