Skip to content
Latchkey

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: 403

Common 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

  1. Honor the Retry-After header when present; otherwise wait at least 60 seconds before retrying.
  2. Serialize matrix API calls or add a small delay between requests.
  3. 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 set

How 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →