From c0aa170aef27aa5409942864318408fee079a6f9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 15 Dec 2025 20:07:48 +0000 Subject: [PATCH 1/5] Initial plan From b0f8f5b913092117a220c8fe9ed252dd9a98c69d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 15 Dec 2025 20:14:46 +0000 Subject: [PATCH 2/5] Add workflow to close inactive author feedback issues Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com> --- .../workflows/close-needs-author-feedback.yml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/close-needs-author-feedback.yml diff --git a/.github/workflows/close-needs-author-feedback.yml b/.github/workflows/close-needs-author-feedback.yml new file mode 100644 index 00000000..dab93e9e --- /dev/null +++ b/.github/workflows/close-needs-author-feedback.yml @@ -0,0 +1,53 @@ +name: Close inactive author feedback issues + +on: + schedule: + - cron: "0 9 * * *" + workflow_dispatch: + +permissions: + contents: read + issues: write + +jobs: + close-inactive: + runs-on: ubuntu-latest + steps: + - name: Close issues waiting on author feedback + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const label = "Needs Author Feedback"; + const daysInactive = 7; + const cutoff = new Date(Date.now() - daysInactive * 24 * 60 * 60 * 1000); + + const { owner, repo } = context.repo; + const issues = await github.paginate(github.rest.issues.listForRepo, { + owner, + repo, + state: "open", + labels: label, + per_page: 100, + sort: "updated", + direction: "asc", + }); + + for (const issue of issues) { + if (issue.pull_request) { + continue; + } + + const updatedAt = new Date(issue.updated_at); + if (updatedAt > cutoff) { + continue; + } + + const body = [ + "We haven't heard back in 7 days, so we're automatically closing this issue.", + "If you still need help, please reply and we'll reopen it." + ].join("\n\n"); + + await github.rest.issues.createComment({ owner, repo, issue_number: issue.number, body }); + await github.rest.issues.update({ owner, repo, issue_number: issue.number, state: "closed" }); + } From 377f9f7e6b9168d965d0c05def92caa264ca7538 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 15 Dec 2025 20:15:52 +0000 Subject: [PATCH 3/5] Improve auto-close workflow resilience Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com> --- .github/workflows/close-needs-author-feedback.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/close-needs-author-feedback.yml b/.github/workflows/close-needs-author-feedback.yml index dab93e9e..904401b3 100644 --- a/.github/workflows/close-needs-author-feedback.yml +++ b/.github/workflows/close-needs-author-feedback.yml @@ -45,9 +45,13 @@ jobs: const body = [ "We haven't heard back in 7 days, so we're automatically closing this issue.", - "If you still need help, please reply and we'll reopen it." + "If you still need help, please reply and we can reopen it." ].join("\n\n"); - await github.rest.issues.createComment({ owner, repo, issue_number: issue.number, body }); - await github.rest.issues.update({ owner, repo, issue_number: issue.number, state: "closed" }); + try { + await github.rest.issues.createComment({ owner, repo, issue_number: issue.number, body }); + await github.rest.issues.update({ owner, repo, issue_number: issue.number, state: "closed" }); + } catch (error) { + core.warning(`Skipping issue #${issue.number} because of an error while closing: ${error}`); + } } From f5da2886625f04a96f844c97cdef84c5b151f716 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 15 Dec 2025 20:16:41 +0000 Subject: [PATCH 4/5] Use console warning in auto-close workflow Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com> --- .github/workflows/close-needs-author-feedback.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/close-needs-author-feedback.yml b/.github/workflows/close-needs-author-feedback.yml index 904401b3..f58e920a 100644 --- a/.github/workflows/close-needs-author-feedback.yml +++ b/.github/workflows/close-needs-author-feedback.yml @@ -52,6 +52,6 @@ jobs: await github.rest.issues.createComment({ owner, repo, issue_number: issue.number, body }); await github.rest.issues.update({ owner, repo, issue_number: issue.number, state: "closed" }); } catch (error) { - core.warning(`Skipping issue #${issue.number} because of an error while closing: ${error}`); + console.warn(`Skipping issue #${issue.number} because of an error while closing: ${error}`); } } From f0679c4fb3c58a0da1e079dcc92b0aae3c3b09a3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 15 Dec 2025 20:17:39 +0000 Subject: [PATCH 5/5] Ensure comment succeeds before closing issues Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com> --- .github/workflows/close-needs-author-feedback.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/close-needs-author-feedback.yml b/.github/workflows/close-needs-author-feedback.yml index f58e920a..547acf6d 100644 --- a/.github/workflows/close-needs-author-feedback.yml +++ b/.github/workflows/close-needs-author-feedback.yml @@ -50,8 +50,14 @@ jobs: try { await github.rest.issues.createComment({ owner, repo, issue_number: issue.number, body }); + } catch (error) { + console.warn(`Skipping issue #${issue.number} because of an error while adding the notice: ${error}`); + continue; + } + + try { await github.rest.issues.update({ owner, repo, issue_number: issue.number, state: "closed" }); } catch (error) { - console.warn(`Skipping issue #${issue.number} because of an error while closing: ${error}`); + console.warn(`Skipping issue #${issue.number} because of an error while processing closure: ${error}`); } }