From 97e37cfb1f7e9e2f956cb8966fdb9248a51d3f97 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Tue, 3 Feb 2026 10:32:18 +0100 Subject: [PATCH] Process oldest issues first; raise page cap Add sort: 'updated' and order: 'asc' to the issues search so closed/unlocked items are processed oldest-first. Improve logging to show items per page and total_count. Increase the pagination limit from 10 to 100 (allowing up to ~10,000 results) and update related comments. --- .github/workflows/lock-issue.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lock-issue.yaml b/.github/workflows/lock-issue.yaml index 5552a0f82..6aa2e49c6 100644 --- a/.github/workflows/lock-issue.yaml +++ b/.github/workflows/lock-issue.yaml @@ -28,20 +28,22 @@ jobs: /dependabot/i ]; - // Search for closed, unlocked issues older than 3 days (paginated) + // Search for closed, unlocked issues older than 3 days (paginated, oldest first) let page = 1; let totalLocked = 0; while (true) { const issues = await github.rest.search.issuesAndPullRequests({ q: `repo:${context.repo.owner}/${context.repo.repo} is:closed is:unlocked updated:<${lockDate.toISOString().split('T')[0]}`, + sort: 'updated', + order: 'asc', per_page: 100, page: page }); if (issues.data.items.length === 0) break; - console.log(`Processing page ${page} with ${issues.data.items.length} issues/PRs`); + console.log(`Page ${page}: ${issues.data.items.length} items (total available: ${issues.data.total_count})`); for (const item of issues.data.items) { // Skip excluded items @@ -68,8 +70,8 @@ jobs: page++; - // GitHub search API limit: max 1000 results - if (page > 10) break; + // GitHub search API limit: max 10000 results (100 pages * 100) - temporarily increased + if (page > 100) break; } console.log(`Total locked: ${totalLocked} issues/PRs`);