From 8a555fb41145c6e63db3a4553a0c8645cc22991c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 8 Dec 2022 12:41:55 -0700 Subject: [PATCH] Add some safety to the proposals script (#1368) * Add some safety to the proposals script for if github's api explodes, forgets the header, or we are rate limited or something. * changelog --- changelogs/internal/newsfragments/1368.clarification | 1 + scripts/proposals.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/internal/newsfragments/1368.clarification diff --git a/changelogs/internal/newsfragments/1368.clarification b/changelogs/internal/newsfragments/1368.clarification new file mode 100644 index 00000000..a08f1ebe --- /dev/null +++ b/changelogs/internal/newsfragments/1368.clarification @@ -0,0 +1 @@ +Improve safety of the proposals retrieval script in the event of failure. \ No newline at end of file diff --git a/scripts/proposals.js b/scripts/proposals.js index 42300b98..dc3f2895 100644 --- a/scripts/proposals.js +++ b/scripts/proposals.js @@ -100,7 +100,7 @@ async function getIssues() { const issuesForPage = await response.json(); issues = issues.concat(issuesForPage); const linkHeader = response.headers.get("link"); - pageLink = getNextLink(linkHeader); + pageLink = !!linkHeader ? getNextLink(linkHeader) : null; } }