Unverified Commit 91c825ee authored by Sam Ko's avatar Sam Ko Committed by GitHub

chore(github-workflow): fix issue_bankrupt workflow again (#66993)

## Why?

Update location of `with` so `getInput('created')` is not undefined.
parent 7a9a0ccd
...@@ -6,19 +6,19 @@ async function main() { ...@@ -6,19 +6,19 @@ async function main() {
const octokit = getOctokit(process.env.GITHUB_TOKEN) const octokit = getOctokit(process.env.GITHUB_TOKEN)
const { owner, repo } = context.repo const { owner, repo } = context.repo
const created = getInput('created') const createdQuery = getInput('created')
const year = created.slice(0, 4) const dateRange = createdQuery.split('..').join(' to ')
const body = ` const body = `
We are in the process of closing issues dating back to ${year} to improve our focus on the most relevant and actionable problems. We are in the process of closing issues dating from ${dateRange} to improve our focus on the most relevant and actionable problems.
**_Why are we doing this?_** **_Why are we doing this?_**
Stale issues often lack recent updates and clear reproductions, making them difficult to address effectively. Our objective is to prioritize the most upvoted and actionable issues that have up-to-date reproductions, enabling us to resolve bugs more efficiently. Stale issues often lack recent updates and clear reproductions, making them difficult to address effectively. Our objective is to prioritize the most upvoted and actionable issues that have up-to-date reproductions, enabling us to resolve bugs more efficiently.
**_Why ${year} issues?_** **_Why these issues?_**
Issues from ${year} are likely to be outdated and less relevant to the current state of the codebase. By closing these older stale issues, we can better focus our efforts on more recent and relevant problems, ensuring a more effective and streamlined workflow. Issues dating from ${dateRange} are likely to be outdated and less relevant to the current state of the codebase. By closing these older stale issues, we can better focus our efforts on more recent and relevant problems, ensuring a more effective and streamlined workflow.
If your issue is still relevant, please reopen it using our [bug report template](https://github.com/vercel/next.js/issues/new?assignees=&labels=bug&projects=&template=1.bug_report.yml). Be sure to include any important context from the original issue in your new report. If your issue is still relevant, please reopen it using our [bug report template](https://github.com/vercel/next.js/issues/new?assignees=&labels=bug&projects=&template=1.bug_report.yml). Be sure to include any important context from the original issue in your new report.
...@@ -30,13 +30,13 @@ The Next.js Team ...@@ -30,13 +30,13 @@ The Next.js Team
let issues: number[] = [] let issues: number[] = []
info(`created = ${created}`) info(`created = ${createdQuery}`)
info(`year = ${year}`) info(`date range = ${dateRange}`)
info(`body = ${body}`) info(`body = ${body}`)
// try { // try {
// const { data } = await octokit.rest.search.issuesAndPullRequests({ // const { data } = await octokit.rest.search.issuesAndPullRequests({
// q: `repo:${owner}/${repo} is:issue is:open created:${created}`, // q: `repo:${owner}/${repo} is:issue is:open created:${createdQuery}`,
// }) // })
// issues = data.items.map((issue) => issue.number) // issues = data.items.map((issue) => issue.number)
......
...@@ -15,11 +15,11 @@ jobs: ...@@ -15,11 +15,11 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
- run: corepack enable
- name: 'Bankrupt issues & send notification to Slack' - name: 'Bankrupt issues & send notification to Slack'
run: node ./.github/actions/next-repo-actions/dist/bankrupt/index.js uses: ./.github/actions/next-repo-actions/dist/bankrupt/index.js
with: with:
created: ${{ github.event.inputs.created }} created: ${{ github.event.inputs.created }}
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }} SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
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