ci: mark and close PRs with formality issues
authorGeorge Sapkin <redacted>
Mon, 10 Nov 2025 16:14:03 +0000 (18:14 +0200)
committerJosef Schlehofer <redacted>
Mon, 4 May 2026 11:12:08 +0000 (13:12 +0200)
Add a recurring workflow that runs every day at 5:30 and marks all PRs
that have formality check failures (i.e. marked as 'not following
guidelines') that have not been active in the past 14 days as stale.
Close stale PRs after 14 more days.

Signed-off-by: George Sapkin <redacted>
.github/workflows/stale-bot.yml [new file with mode: 0644]

diff --git a/.github/workflows/stale-bot.yml b/.github/workflows/stale-bot.yml
new file mode 100644 (file)
index 0000000..5099929
--- /dev/null
@@ -0,0 +1,30 @@
+name: Mark and close stale PRs
+
+on:
+  schedule:
+    # Run once a day at 05:30
+    - cron: '30 5 * * *'
+
+permissions:
+  actions: write
+  # BUG: required due to a bug in the stale action:
+  #      https://github.com/actions/stale/issues/840#issuecomment-2195082494
+  issues: read
+  pull-requests: write
+
+jobs:
+  stale:
+    runs-on: ubuntu-slim
+    steps:
+      - name: Mark and close PRs with formality issues
+        uses: actions/stale@v10
+        with:
+          repo-token: ${{ secrets.GITHUB_TOKEN }}
+          stale-pr-message: |
+            This PR is stale because it has been open for 14 days with no activity and has the "not following guidelines" label.
+            It will be closed if no further activity occurs within 14 days.
+          close-pr-message: 'This PR was closed because it has been marked stale for 14 days with no activity.'
+          days-before-stale: 14
+          days-before-close: 14
+          only-labels: 'not following guidelines'
+          stale-pr-label: 'stale'
git clone https://git.99rst.org/PROJECT