mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 05:05:00 -07:00
[Backport release-0.9] ci(response): use pagination for timeline events (#23844)
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.
(cherry picked from commit b5a8b6b16d
)
Co-authored-by: dundargoc <gocdundar@gmail.com>
This commit is contained in:
parent
4b79441b14
commit
06d137681e
13
.github/scripts/close_unresponsive.js
vendored
13
.github/scripts/close_unresponsive.js
vendored
@ -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({
|
||||
const events = await github.paginate(
|
||||
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];
|
||||
},
|
||||
(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;
|
||||
|
Loading…
Reference in New Issue
Block a user