neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 1cbfed03c249e7f9e67d59566fbabe46f7f7f1f9
parent 416f03010e3c776e820a30f5ef1c553df5252d3b
Author: dundargoc <33953936+dundargoc@users.noreply.github.com>
Date:   Sun,  7 May 2023 16:46:24 +0200

ci(response): use pagination for timeline events

GitHub paginates responses with many results, which needs to be taken
into account as the number of events in an issue can be large.
Diffstat:
M.github/scripts/close_unresponsive.js | 19++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/.github/scripts/close_unresponsive.js b/.github/scripts/close_unresponsive.js @@ -19,13 +19,18 @@ module.exports = async ({ github, context }) => { const numbers = issues.data.map((e) => e.number); for (const number of numbers) { - const timeline = await github.rest.issues.listEventsForTimeline({ - owner: owner, - repo: repo, - issue_number: number, - }); - const data = timeline.data.filter(labeledEvent); - const latest_response_label = data[data.length - 1]; + const events = await github.paginate( + github.rest.issues.listEventsForTimeline, + { + owner: owner, + repo: repo, + issue_number: number, + }, + (response) => response.data.filter(labeledEvent) + ); + + const latest_response_label = events[events.length - 1]; + const created_at = new Date(latest_response_label.created_at); const now = new Date(); const diff = now - created_at;