Unverified Commit 8f90c352 authored by Sam Ko's avatar Sam Ko Committed by GitHub

chore(github): reduce per_page to 25 for issues-by-version (#69974)

## Why?

We're running into the GitHub rate limit when querying for 50
`per_page`, so reducing to 25.

Also adding logic throw a `info(...)` message when no issues by <xyz>
version are found.
parent 1d94f6c7
...@@ -17,7 +17,7 @@ async function main() { ...@@ -17,7 +17,7 @@ async function main() {
try { try {
const { data: issues } = await octokit.rest.search.issuesAndPullRequests({ const { data: issues } = await octokit.rest.search.issuesAndPullRequests({
order: 'desc', order: 'desc',
per_page: 50, per_page: 25,
q: `repo:${owner}/${repo} is:issue is:open`, q: `repo:${owner}/${repo} is:issue is:open`,
}) })
...@@ -25,6 +25,7 @@ async function main() { ...@@ -25,6 +25,7 @@ async function main() {
(issue) => issue.body && issue.body.includes(`${version}`) (issue) => issue.body && issue.body.includes(`${version}`)
) )
if (filteredIssues.length > 0) {
const blocks = BlockCollection([ const blocks = BlockCollection([
Section({ Section({
text: `*A list of the most recently created, open issues that are on v${version}.*\n_Note: This :github2: <https://github.com/vercel/next.js/blob/canary/.github/workflows/issue_version.yml|workflow> queries the 50 most recent issues, then filters them to only include issues that mention v${version}._`, text: `*A list of the most recently created, open issues that are on v${version}.*\n_Note: This :github2: <https://github.com/vercel/next.js/blob/canary/.github/workflows/issue_version.yml|workflow> queries the 50 most recent issues, then filters them to only include issues that mention v${version}._`,
...@@ -48,6 +49,9 @@ async function main() { ...@@ -48,6 +49,9 @@ async function main() {
}) })
info(`Posted to Slack!`) info(`Posted to Slack!`)
} else {
info(`No issues found for ${version}.`)
}
} catch (error) { } catch (error) {
setFailed(error) setFailed(error)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment