ci: track meaningful pull request inactivity

Use human activity and observed head changes because GitHub can update PR timestamps without contributor activity.

Audit every open PR before applying changes and start existing PRs from a safe baseline.
This commit is contained in:
neon
2026-09-26 15:48:02 +00:00
parent 04ba2ffbcf
commit a0477f0d0b
8 changed files with 616 additions and 14 deletions
+41
View File
@@ -0,0 +1,41 @@
name: Stale Pull Requests
on:
schedule:
- cron: "30 3 * * *"
workflow_dispatch:
inputs:
mode:
description: Run without changes or apply the PR inactivity policy
type: choice
required: true
default: dry-run
options:
- dry-run
- apply
permissions:
contents: read
issues: write
pull-requests: write
concurrency:
group: stale-pull-requests
cancel-in-progress: false
jobs:
stale-prs:
name: Check Every Open PR
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
- name: Check PR inactivity
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_REPOSITORY: ${{ github.repository }}
RUN_MODE: ${{ github.event_name == 'schedule' && 'apply' || inputs.mode }}
run: node scripts/stale-prs/run.mjs "--${RUN_MODE}"