GitHub Actions "You have exceeded a secondary rate limit"
Secondary (abuse) rate limits trip on burst patterns - too many requests in a short window, too many concurrent requests, or too many writes to the same resource - independent of the hourly primary quota.
What this error means
A step calling the GitHub API (gh, github-script, or curl) fails with a 403 secondary rate limit message.
github-actions
RequestError [HttpError]: You have exceeded a secondary rate limit.
Please wait a few minutes before you try again.
status: 403Common causes
Bursty or concurrent API calls
Tight loops, paginated fetches without delay, or many matrix jobs hitting the API at once trigger the abuse detector.
Repeated writes to one resource
Rapid comment/label/dispatch writes on the same issue or repo are throttled harder than reads.
How to fix it
Back off and retry
- Honor the Retry-After header when present; otherwise wait at least 60 seconds before retrying.
- Serialize matrix API calls or add a small delay between requests.
- Use github-script with octokit throttling plugin behavior rather than a tight curl loop.
.github/workflows/api.yml
- uses: actions/github-script@v7
with:
retries: 3
script: |
// octokit auto-backs-off on secondary limits with retries setHow to prevent it
- Avoid concurrent writes to the same resource across matrix legs.
- Cache API results instead of re-fetching the same data per job.
Related guides
GitHub Actions "too many requests to the GitHub API" (rate limited in workflow)Fix GitHub Actions jobs that hit GitHub API rate limits mid-run - too many requests from gh, github-script, o…
actions/stale "GraphQL: secondary rate limit"Fix actions/stale hitting GitHub's secondary rate limit when processing many issues/PRs in one run.
GitHub Actions github-script "secondary rate limit" / 403 Abuse DetectionFix actions/github-script hitting a secondary rate limit - too many rapid API writes trigger 403 abuse detect…