From 71cc73253df383d49d4bbcea021b0f8660d2aa20 Mon Sep 17 00:00:00 2001 From: Yasset Perez-Riverol Date: Tue, 7 Jul 2026 16:31:52 +0100 Subject: [PATCH] ci: add stale-PR workflow (close after 6 months of inactivity) Marks a PR stale after 180 days without activity, warns, and closes it 14 days later if still no response, with a message inviting the author to re-open. Issues are untouched; a 'keep' label exempts a PR; any comment or push clears the stale mark. Uses the official actions/stale, oldest-first with an ops cap so the existing backlog is closed gradually, not all at once. --- .github/workflows/stale.yml | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 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 00000000..a19d0b01 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,54 @@ +# Auto-close pull requests whose author hasn't returned in ~6 months. +# A PR is marked "stale" after 180 days of inactivity, warned, then closed 14 +# days later if still no response. Any comment or new commit clears the stale +# mark; a closed PR can be reopened (or a fresh PR opened) at any time. Issues +# are deliberately left untouched. Add a "keep" label to exempt a PR. +name: stale-prs + +on: + schedule: + - cron: "30 1 * * *" # daily, 01:30 UTC + workflow_dispatch: # allow manual runs / dry runs + +permissions: + contents: read + issues: write # labelling/commenting a PR uses the issues API + pull-requests: write + +concurrency: + group: stale-prs + cancel-in-progress: false + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v9 + with: + # Pull requests only — never touch issues. + days-before-issue-stale: -1 + days-before-issue-close: -1 + + # ~6 months with no activity -> stale; 14 more days of silence -> close. + days-before-pr-stale: 180 + days-before-pr-close: 14 + + stale-pr-label: stale + exempt-pr-labels: keep,pinned,security,wip,blocked + exempt-draft-pr: true + + stale-pr-message: > + 👋 This pull request hasn't had any activity for 6 months, so it has + been marked **stale**. If it's still relevant, just leave a comment or + push an update and we'll take another look — otherwise it will be + closed in 14 days. + + close-pr-message: > + This PR has been **staled** after 6+ months without activity and is + being closed to keep the review queue tidy. No work is lost — please + **re-open it** (or open a fresh PR) whenever you'd like to continue. + + # Oldest first, and cap API calls per run so a large backlog is worked + # through gradually over several daily runs rather than all at once. + ascending: true + operations-per-run: 60