Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update issue_popular workflow to 90 days #60860

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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