Skip to content

Stale PR Manager

Stale PR Manager #1

name: Stale PR Manager
on:
schedule:
# Runs at 00:00 UTC on the first day of every month
- cron: '0 0 1 * *'
workflow_dispatch: # Allows manual triggering for testing
inputs:
stale_days:
description: 'Number of days before marking/closing as stale'
required: false
default: '30'
type: string
permissions:
contents: read
pull-requests: write
issues: write
env:
STALE_DAYS: ${{ github.event.inputs.stale_days || '30' }}
jobs:
manage-stale-prs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Manage Stale PRs
run: node .github/scripts/stale-pr-manager.mjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
STALE_DAYS: ${{ env.STALE_DAYS }}
STALE_LABEL: ${{ vars.STALE_LABEL || 'stale' }}