From 0c77274e4e0e4690ff00bdf2a77689bea4c3ef23 Mon Sep 17 00:00:00 2001 From: peterstone2017 <12449837+YunchuWang@users.noreply.github.com> Date: Mon, 15 Dec 2025 14:23:24 -0800 Subject: [PATCH 1/6] Update to use stale github issue action --- .../workflows/close-needs-author-feedback.yml | 75 +++++-------------- 1 file changed, 19 insertions(+), 56 deletions(-) diff --git a/.github/workflows/close-needs-author-feedback.yml b/.github/workflows/close-needs-author-feedback.yml index 547acf6d1..dea3cf86a 100644 --- a/.github/workflows/close-needs-author-feedback.yml +++ b/.github/workflows/close-needs-author-feedback.yml @@ -1,63 +1,26 @@ -name: Close inactive author feedback issues - +name: Close inactive issues on: schedule: - - cron: "0 9 * * *" - workflow_dispatch: - -permissions: - contents: read - issues: write + - cron: "0 1 * * *" # run daily jobs: - close-inactive: + stale: runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: - - name: Close issues waiting on author feedback - uses: actions/github-script@v7 + - uses: actions/stale@v10 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 can reopen it." - ].join("\n\n"); - - 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 processing closure: ${error}`); - } - } + # issues that haven’t updated in 30 days become stale + days-before-issue-stale: 30 + # issues labeled stale will be closed 14 days later + days-before-issue-close: 14 + stale-issue-label: "stale" + stale-issue-message: "This issue has gone quiet — please respond!" + close-issue-message: "Closing this issue as inactive." + # don’t process PRs + days-before-pr-stale: -1 + days-before-pr-close: -1 + repo-token: ${{ secrets.GITHUB_TOKEN }} From a82b354ef4675e401def24ec1c157f14b2ddbeaf Mon Sep 17 00:00:00 2001 From: peterstone2017 <12449837+YunchuWang@users.noreply.github.com> Date: Mon, 15 Dec 2025 14:29:34 -0800 Subject: [PATCH 2/6] make it longer --- .github/workflows/close-needs-author-feedback.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/close-needs-author-feedback.yml b/.github/workflows/close-needs-author-feedback.yml index dea3cf86a..1f081b9e4 100644 --- a/.github/workflows/close-needs-author-feedback.yml +++ b/.github/workflows/close-needs-author-feedback.yml @@ -14,9 +14,9 @@ jobs: - uses: actions/stale@v10 with: # issues that haven’t updated in 30 days become stale - days-before-issue-stale: 30 + days-before-issue-stale: 45 # issues labeled stale will be closed 14 days later - days-before-issue-close: 14 + days-before-issue-close: 30 stale-issue-label: "stale" stale-issue-message: "This issue has gone quiet — please respond!" close-issue-message: "Closing this issue as inactive." From 238a461fe12318b55f8f60a55d058e9d0860fd1e Mon Sep 17 00:00:00 2001 From: peterstone2017 <12449837+YunchuWang@users.noreply.github.com> Date: Mon, 15 Dec 2025 14:33:03 -0800 Subject: [PATCH 3/6] only scan need autho feedback issues --- .github/workflows/close-needs-author-feedback.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/close-needs-author-feedback.yml b/.github/workflows/close-needs-author-feedback.yml index 1f081b9e4..37c5334fb 100644 --- a/.github/workflows/close-needs-author-feedback.yml +++ b/.github/workflows/close-needs-author-feedback.yml @@ -14,9 +14,10 @@ jobs: - uses: actions/stale@v10 with: # issues that haven’t updated in 30 days become stale - days-before-issue-stale: 45 + days-before-issue-stale: 30 # issues labeled stale will be closed 14 days later - days-before-issue-close: 30 + days-before-issue-close: 14 + only-issue-labels: "Needs: Author Feedback" stale-issue-label: "stale" stale-issue-message: "This issue has gone quiet — please respond!" close-issue-message: "Closing this issue as inactive." From 57ba187b31a3fd2fa27d3a1d6a637141bc252474 Mon Sep 17 00:00:00 2001 From: peterstone2017 <12449837+YunchuWang@users.noreply.github.com> Date: Mon, 15 Dec 2025 14:35:31 -0800 Subject: [PATCH 4/6] action permission --- .github/workflows/close-needs-author-feedback.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/close-needs-author-feedback.yml b/.github/workflows/close-needs-author-feedback.yml index 37c5334fb..3b145640f 100644 --- a/.github/workflows/close-needs-author-feedback.yml +++ b/.github/workflows/close-needs-author-feedback.yml @@ -9,6 +9,7 @@ jobs: permissions: issues: write pull-requests: write + actions: write steps: - uses: actions/stale@v10 From b1284d3fa54cf0f4367bcf600b4573943bbb0dd4 Mon Sep 17 00:00:00 2001 From: peterstone2017 <12449837+YunchuWang@users.noreply.github.com> Date: Mon, 15 Dec 2025 14:39:00 -0800 Subject: [PATCH 5/6] comments --- .github/workflows/close-needs-author-feedback.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/close-needs-author-feedback.yml b/.github/workflows/close-needs-author-feedback.yml index 3b145640f..bae4e75f6 100644 --- a/.github/workflows/close-needs-author-feedback.yml +++ b/.github/workflows/close-needs-author-feedback.yml @@ -1,14 +1,14 @@ -name: Close inactive issues +name: Close inactive author feedback issues on: schedule: - cron: "0 1 * * *" # run daily + workflow_dispatch: jobs: stale: runs-on: ubuntu-latest permissions: issues: write - pull-requests: write actions: write steps: @@ -20,8 +20,8 @@ jobs: days-before-issue-close: 14 only-issue-labels: "Needs: Author Feedback" stale-issue-label: "stale" - stale-issue-message: "This issue has gone quiet — please respond!" - close-issue-message: "Closing this issue as inactive." + stale-issue-message: "This issue has been marked as stale because there has been no recent activity. Please provide any additional information or updates if this issue is still relevant. If no further activity occurs, this issue will be closed in 14 days. Thank you for your contributions!" + close-issue-message: "Closing this issue as inactive. If you still need help, please reply and we can reopen it" # don’t process PRs days-before-pr-stale: -1 days-before-pr-close: -1 From cc13bcb6ac780db77acb9d0ce1b616336692b079 Mon Sep 17 00:00:00 2001 From: peterstone2017 <12449837+YunchuWang@users.noreply.github.com> Date: Mon, 15 Dec 2025 14:41:25 -0800 Subject: [PATCH 6/6] delete stale ci --- .../workflows/close-needs-author-feedback.yml | 28 ------------------- 1 file changed, 28 deletions(-) delete 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 deleted file mode 100644 index bae4e75f6..000000000 --- a/.github/workflows/close-needs-author-feedback.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Close inactive author feedback issues -on: - schedule: - - cron: "0 1 * * *" # run daily - workflow_dispatch: - -jobs: - stale: - runs-on: ubuntu-latest - permissions: - issues: write - actions: write - - steps: - - uses: actions/stale@v10 - with: - # issues that haven’t updated in 30 days become stale - days-before-issue-stale: 30 - # issues labeled stale will be closed 14 days later - days-before-issue-close: 14 - only-issue-labels: "Needs: Author Feedback" - stale-issue-label: "stale" - stale-issue-message: "This issue has been marked as stale because there has been no recent activity. Please provide any additional information or updates if this issue is still relevant. If no further activity occurs, this issue will be closed in 14 days. Thank you for your contributions!" - close-issue-message: "Closing this issue as inactive. If you still need help, please reply and we can reopen it" - # don’t process PRs - days-before-pr-stale: -1 - days-before-pr-close: -1 - repo-token: ${{ secrets.GITHUB_TOKEN }}