Skip to content

Commit

Permalink
chore: update issue_popular workflow to 90 days (#60860)
Browse files Browse the repository at this point in the history
## Changes

- Update issue_popular to 90 days for broader look at issues

Closes NEXT-2163
  • Loading branch information
samcx authored Jan 19, 2024
1 parent 3734ae8 commit 3a8436b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/actions/next-repo-info/dist/issues/index.mjs

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions .github/actions/next-repo-info/src/popular-issues.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { context, getOctokit } from '@actions/github'
import { setFailed, info } from '@actions/core'
import { WebClient } from '@slack/web-api'

// Get the date one month ago (YYYY-MM-DD)
function getOneMonthAgoDate() {
// Get the date 90 days ago (YYYY-MM-DD)
function getNinetyDaysAgoDate() {
const date = new Date()
date.setMonth(date.getMonth() - 1)
date.setDate(date.getDate() - 90)
return date.toISOString().split('T')[0]
}

Expand Down Expand Up @@ -47,12 +47,12 @@ async function run() {
const octoClient = getOctokit(process.env.GITHUB_TOKEN)
const slackClient = new WebClient(process.env.SLACK_TOKEN)

const oneMonthAgo = getOneMonthAgoDate()
const ninetyDaysAgo = getNinetyDaysAgoDate()
const { owner, repo } = context.repo
const { data } = await octoClient.rest.search.issuesAndPullRequests({
order: 'desc',
per_page: 15,
q: `repo:${owner}/${repo} is:issue is:open created:>=${oneMonthAgo}`,
q: `repo:${owner}/${repo} is:issue is:open created:>=${ninetyDaysAgo}`,
sort: 'reactions-+1',
})

Expand Down

0 comments on commit 3a8436b

Please sign in to comment.