Skip to content
Latchkey

GitHub Actions actions/stale "API rate limit exceeded"

actions/stale paginates through issues and pull requests and makes an API call per action it takes. On a large backlog it can exhaust the hourly REST API limit for the token in a single run.

What this error means

A stale workflow fails partway through with "API rate limit exceeded", leaving some issues unprocessed.

github-actions
Error: API rate limit exceeded for installation ID xxxxx.
##[error]You have exceeded a secondary rate limit.

Common causes

Too many operations per run

A large backlog plus a high operations-per-run consumes the API budget quickly.

Secondary rate limits

Rapid write operations can trip secondary abuse limits even below the primary cap.

How to fix it

Throttle the stale run

  1. Lower operations-per-run to spread work across scheduled runs.
  2. Run the workflow more frequently with smaller batches.
  3. Narrow the scope with labels or only-issues/only-PRs.
.github/workflows/stale.yml
- uses: actions/stale@v9
  with:
    operations-per-run: 30
    days-before-stale: 60

How to prevent it

  • Tune operations-per-run to your backlog size.
  • Schedule frequent small runs instead of one large sweep.

Related guides

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