Skip to content

Issue Close Require #823

Issue Close Require

Issue Close Require #823

name: Issue Close Require
on:
schedule:
- cron: '0 0 * * *'
permissions:
issues: write
jobs:
close-issues:
if: github.repository == 'vitest-dev/vscode'
runs-on: ubuntu-latest
steps:
- name: needs reproduction
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
with:
script: |
const inactiveDays = 3;
const cutoff = Date.now() - inactiveDays * 24 * 60 * 60 * 1000;
const issues = await github.paginate(github.rest.issues.listForRepo, {
owner: context.repo.owner,
repo: context.repo.repo,
labels: 'needs reproduction',
state: 'open',
per_page: 100,
});
for (const issue of issues) {
if (issue.pull_request) continue;
if (new Date(issue.updated_at).getTime() > cutoff) continue;
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
state: 'closed',
state_reason: 'not_planned',
});
}