Unverified Commit 3a8436b1 authored by Sam Ko's avatar Sam Ko Committed by GitHub

chore: update issue_popular workflow to 90 days (#60860)

## Changes

- Update issue_popular to 90 days for broader look at issues

Closes NEXT-2163
parent 3734ae88
......@@ -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]
}
......@@ -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',
})
......
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