From 45d3741e6d8d10aad7a329f78c01042fe3291fb8 Mon Sep 17 00:00:00 2001 From: zeevdr Date: Tue, 28 Apr 2026 15:17:08 +0300 Subject: [PATCH] ci: add stale bot for inactive issues and PRs Refs opendecree/decree#162. Daily cron marks issues stale at 60d (close at 74d) and PRs stale at 30d (close at 37d). Exempt labels: `keep` for both; issues also exempt `good first issue` and `bug`. Issues close with reason `not_planned`. Self-contained per-repo workflow (decided over a reusable in opendecree/.github) so each project can tune independently. The `keep` label has been pre-created in this repo. Co-Authored-By: Claude Opus 4.7 (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..e5e15c9 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,47 @@ +name: Stale issues and PRs + +# Daily sweep: marks inactive issues/PRs as stale and eventually closes +# them. The `keep` label opts an item out entirely; `good first issue` +# and `bug` are also exempt for issues. opendecree/decree#162. +# +# Tuning happens here per-repo so each project can adjust independently +# if traffic patterns diverge. + +on: + schedule: + - cron: '30 1 * * *' # daily 01:30 UTC + workflow_dispatch: + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/stale@v9 + with: + stale-issue-message: > + This issue has been inactive for 60 days and is being marked + stale. It will be closed in 14 days unless there is new + activity. Add the `keep` label to opt out of future sweeps. + stale-pr-message: > + This PR has been inactive for 30 days and is being marked + stale. It will be closed in 7 days unless there is new + activity. Add the `keep` label to opt out of future sweeps. + close-issue-message: > + Closing for inactivity. Reopen if this is still relevant. + close-pr-message: > + Closing for inactivity. Reopen if this is still relevant. + stale-issue-label: stale + stale-pr-label: stale + days-before-issue-stale: 60 + days-before-issue-close: 14 + days-before-pr-stale: 30 + days-before-pr-close: 7 + exempt-issue-labels: 'keep,good first issue,bug' + exempt-pr-labels: 'keep' + close-issue-reason: not_planned + operations-per-run: 100