Skip to content

Commit

Permalink
fix(plugin): do not call GitHub content API for releases and tags [ba…
Browse files Browse the repository at this point in the history
…ckport: release/v0.54] (#7279)

Signed-off-by: knqyf263 <[email protected]>
Co-authored-by: Teppei Fukuda <[email protected]>
  • Loading branch information
aqua-bot and knqyf263 authored Jul 31, 2024
1 parent ff403a3 commit a7b7117
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/downloader/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ func (t *CustomTransport) RoundTrip(req *http.Request) (*http.Response, error) {
func NewGitHubTransport(u *url.URL, insecure bool, token string) http.RoundTripper {
client := newGitHubClient(insecure, token)
ss := strings.SplitN(u.Path, "/", 4)
if len(ss) < 4 || strings.HasPrefix(ss[3], "archive/") {
if len(ss) < 4 || strings.HasPrefix(ss[3], "archive/") || strings.HasPrefix(ss[3], "releases/") ||
strings.HasPrefix(ss[3], "tags/") {
// Use the default transport from go-github for authentication
return client.Client().Transport
}
Expand Down

0 comments on commit a7b7117

Please sign in to comment.