Unverified Commit 9a5b971f authored by Sam Ko's avatar Sam Ko Committed by GitHub

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

## Why?

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

Closes NEXT-3271
parent 9870faf7
......@@ -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) {
......
......@@ -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) {
......
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