chore(github-workflow): update to check all reactions (#65228)

## Why?

We should check `reaction.total_count`, not just 👍🏼 reactions.

Closes NEXT-3271
This commit is contained in:
Sam Ko 2024-05-01 14:33:16 -04:00 committed by GitHub
parent 9870faf789
commit 9a5b971fc6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 13 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -10,7 +10,7 @@ function generateBlocks(issues) {
type: 'section',
text: {
type: 'mrkdwn',
text: '*A list of the top 15 issues sorted by most :+1: reactions over the last 90 days.*\n_Note: This :github2: <https://github.com/vercel/next.js/blob/canary/.github/workflows/popular.yml|workflow> → <https://github.com/vercel/next.js/blob/canary/.github/actions/next-repo-info/src/popular-issues.mjs|action> will run every Monday at 10AM UTC (6AM EST)._',
text: '*A list of the top 15 issues sorted by the most reactions over the last 90 days.*\n_Note: This :github2: <https://github.com/vercel/next.js/blob/canary/.github/workflows/popular.yml|workflow> → <https://github.com/vercel/next.js/blob/canary/.github/actions/next-repo-info/src/popular-issues.mjs|action> will run every Monday at 10AM UTC (6AM EST)._',
},
},
{
@ -21,9 +21,9 @@ function generateBlocks(issues) {
let text = ''
issues.forEach((issue, i) => {
text += `${i + 1}. [<${issue.html_url}|#${issue.number}>, :+1: ${
issue.reactions['+1']
}, ${formattedDate(issue.created_at)}]: ${issue.title}\n`
text += `${i + 1}. [<${issue.html_url}|#${issue.number}>, ${
issue.reactions.total_count
} reactions, ${formattedDate(issue.created_at)}]: ${issue.title}\n`
})
blocks.push({
@ -50,7 +50,7 @@ async function run() {
order: 'desc',
per_page: 15,
q: `repo:${owner}/${repo} is:issue is:open created:>=${ninetyDaysAgo()}`,
sort: 'reactions-+1',
sort: 'reactions',
})
if (data.items.length > 0) {

View file

@ -15,10 +15,10 @@ function generateBlocks(prs) {
]
prs.forEach((pr, i) => {
if (pr.reactions['+1'] > 1) {
text += `${i + 1}. [<${pr.html_url}|#${pr.number}>, :+1: ${
pr.reactions['+1']
}, ${formattedDate(pr.created_at)}]: ${pr.title}\n`
if (pr.reactions.total_count > 1) {
text += `${i + 1}. [<${pr.html_url}|#${pr.number}>, ${
pr.reactions.total_count
} reactions, ${formattedDate(pr.created_at)}]: ${pr.title}\n`
count++
}
})
@ -27,7 +27,7 @@ function generateBlocks(prs) {
type: 'section',
text: {
type: 'mrkdwn',
text: `*A list of the top ${count} PRs sorted by most :+1: reactions (> 1) over the last 90 days.*\n_Note: This :github2: <https://github.com/vercel/next.js/blob/canary/.github/workflows/popular.yml|workflow> → <https://github.com/vercel/next.js/blob/canary/.github/actions/next-repo-info/src/popular-prs.mjs|action> will run every Monday at 10AM UTC (6AM EST)._`,
text: `*A list of the top ${count} PRs sorted by the most reactions (> 1) over the last 90 days.*\n_Note: This :github2: <https://github.com/vercel/next.js/blob/canary/.github/workflows/popular.yml|workflow> → <https://github.com/vercel/next.js/blob/canary/.github/actions/next-repo-info/src/popular-prs.mjs|action> will run every Monday at 10AM UTC (6AM EST)._`,
},
})
@ -55,7 +55,7 @@ async function run() {
order: 'desc',
per_page: 15,
q: `repo:${owner}/${repo} -is:draft is:pr is:open created:>=${ninetyDaysAgo()}`,
sort: 'reactions-+1',
sort: 'reactions',
})
if (data.items.length > 0) {