Skip to content

Commit fa36421

Browse files
ci: gh rate limit exhaust
1 parent 5bcdfd8 commit fa36421

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

cmd/upgrade/upgrade.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ func fetchLatestRelease() (*githubRelease, error) {
170170
}
171171
defer resp.Body.Close() //nolint:errcheck
172172

173+
// GH sends 403 on rate limit exhaust
174+
if resp.StatusCode == http.StatusForbidden || resp.StatusCode == http.StatusTooManyRequests {
175+
return nil, fmt.Errorf("GitHub API rate limit reached — try again in a few minutes")
176+
}
173177
if resp.StatusCode != http.StatusOK {
174178
return nil, fmt.Errorf("GitHub API returned %d", resp.StatusCode)
175179
}

0 commit comments

Comments
 (0)