From 5f4af9cd1268db0ddf392e8c32313d81760b52c3 Mon Sep 17 00:00:00 2001 From: pkuwkl Date: Thu, 23 Jul 2026 23:45:05 +0800 Subject: [PATCH] chore(harness): add actions/stale workflow to auto-close inactive issues and PRs Add GitHub's maintained actions/stale action on a daily schedule. Issues and pull requests inactive for 14 days are marked stale with a comment, then closed 7 days later if still untouched; any comment, commit, or label change resets the clock. help wanted and good first issue labels are exempt, and draft PRs are never marked stale. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/stale.yml | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..0d690d4 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,47 @@ +name: Stale + +# Two-phase inactivity policy: mark stale (with a comment) after 14 days of +# inactivity, then close 7 days later if still untouched. Any comment, commit, +# or label change resets the clock and clears the stale label. + +on: + schedule: + - cron: '0 1 * * *' # Daily at 01:00 UTC. + workflow_dispatch: {} + +permissions: + issues: write + pull-requests: write + +concurrency: + group: stale + cancel-in-progress: false + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v9 + with: + days-before-stale: 14 + days-before-close: 7 + stale-issue-label: stale + stale-pr-label: stale + exempt-issue-labels: 'help wanted,good first issue' + exempt-pr-labels: 'help wanted,good first issue' + exempt-draft-pr: true + operations-per-run: 60 + stale-issue-message: > + This issue has been inactive for 14 days and is now marked stale. + It will be closed in 7 days if there is no further activity. Comment + or remove the stale label to keep it open. + stale-pr-message: > + This pull request has been inactive for 14 days and is now marked + stale. It will be closed in 7 days if there is no further activity. + Comment or remove the stale label to keep it open. + close-issue-message: > + Closing after 21 days of inactivity. Comment to reopen if this is + still relevant. + close-pr-message: > + Closing after 21 days of inactivity. Reopen when you are ready to + pick this back up.