Skip to content

Commit

Permalink
fix(plugin): do not call GitHub content API for releases and tags (#7274
Browse files Browse the repository at this point in the history
)

Signed-off-by: knqyf263 <[email protected]>
  • Loading branch information
knqyf263 authored and actions-user committed Jul 31, 2024
1 parent ff403a3 commit 918872a
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 918872a

Please sign in to comment.