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) { ...@@ -10,7 +10,7 @@ function generateBlocks(issues) {
type: 'section', type: 'section',
text: { text: {
type: 'mrkdwn', 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) { ...@@ -21,9 +21,9 @@ function generateBlocks(issues) {
let text = '' let text = ''
issues.forEach((issue, i) => { issues.forEach((issue, i) => {
text += `${i + 1}. [<${issue.html_url}|#${issue.number}>, :+1: ${ text += `${i + 1}. [<${issue.html_url}|#${issue.number}>, ${
issue.reactions['+1'] issue.reactions.total_count
}, ${formattedDate(issue.created_at)}]: ${issue.title}\n` } reactions, ${formattedDate(issue.created_at)}]: ${issue.title}\n`
}) })
blocks.push({ blocks.push({
...@@ -50,7 +50,7 @@ async function run() { ...@@ -50,7 +50,7 @@ async function run() {
order: 'desc', order: 'desc',
per_page: 15, per_page: 15,
q: `repo:${owner}/${repo} is:issue is:open created:>=${ninetyDaysAgo()}`, q: `repo:${owner}/${repo} is:issue is:open created:>=${ninetyDaysAgo()}`,
sort: 'reactions-+1', sort: 'reactions',
}) })
if (data.items.length > 0) { if (data.items.length > 0) {
......
...@@ -15,10 +15,10 @@ function generateBlocks(prs) { ...@@ -15,10 +15,10 @@ function generateBlocks(prs) {
] ]
prs.forEach((pr, i) => { prs.forEach((pr, i) => {
if (pr.reactions['+1'] > 1) { if (pr.reactions.total_count > 1) {
text += `${i + 1}. [<${pr.html_url}|#${pr.number}>, :+1: ${ text += `${i + 1}. [<${pr.html_url}|#${pr.number}>, ${
pr.reactions['+1'] pr.reactions.total_count
}, ${formattedDate(pr.created_at)}]: ${pr.title}\n` } reactions, ${formattedDate(pr.created_at)}]: ${pr.title}\n`
count++ count++
} }
}) })
...@@ -27,7 +27,7 @@ function generateBlocks(prs) { ...@@ -27,7 +27,7 @@ function generateBlocks(prs) {
type: 'section', type: 'section',
text: { text: {
type: 'mrkdwn', 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() { ...@@ -55,7 +55,7 @@ async function run() {
order: 'desc', order: 'desc',
per_page: 15, per_page: 15,
q: `repo:${owner}/${repo} -is:draft is:pr is:open created:>=${ninetyDaysAgo()}`, q: `repo:${owner}/${repo} -is:draft is:pr is:open created:>=${ninetyDaysAgo()}`,
sort: 'reactions-+1', sort: 'reactions',
}) })
if (data.items.length > 0) { 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