Closing items while paginating can skip open pull requests

Open
#1,360 5 comments 0 reactions 1 assignee View on GitHub

@v-chiranjib-swain is already working on this.

Since Aug 18, 2026.

  • #1369 by @v-chiranjib-swain — open

Assessment

This issue has not been assessed yet.

Description

bug

Description:
Closing stale pull requests while traversing numbered pages of open items can cause later items to be skipped. IssuesProcessor.processIssues() fetches a 100-item page, processes and potentially closes those items, and then requests page + 1 from the now-smaller state: open result set. If enough items are closed, the offset for the next page can move past unprocessed items or return an empty page.

We observed a run process 200 pull requests, close 104 of them, consume 627 of its configured 1,000 operations, and then report No more issues found to process. Exiting.... An older eligible pull request had no entry in the log. The repository had more than 200 open pull requests at the start of the run, so the action had not traversed the complete initial set.

The current v11 source appears to retain the same numbered-page traversal in src/classes/issues-processor.ts.

Action version:
v9 for the observed run. The traversal pattern also appears present in v11.0.0, but we have not reproduced the run on v11 yet.

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:

  1. Create a repository with more than 200 open pull requests, with over 100 eligible for immediate stale closure.

  2. Configure the action with a sufficiently high operation budget and immediate closure, for example:

    - uses: actions/stale@v9
      with:
        days-before-pr-stale: 30
        days-before-pr-close: 0
        operations-per-run: 1000
        days-before-issue-stale: -1
        days-before-issue-close: -1
    
  3. Run the action and inspect the final statistics and per-PR log entries.

  4. Compare the processed PRs with the open PRs present when the run began.

Expected behavior:
The action should continue until it has inspected every item in the initial open result set or until the operation budget is exhausted. If the budget is exhausted, continuation state should preserve progress for the next run.

Actual behavior:
The action stopped after two 100-item pages and 627 operations, reported that no more items existed, and reset its continuation state even though older open pull requests had not been inspected.

Dominant language
TypeScript
Stars
1.7k
Forks
438
Avg merge
27d 8h
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from actions/stale

All issues in actions/stale

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.