name: Stale Issues

on:
  schedule:
    - cron: '0 6 * * 1'  # Every Monday at 6am UTC
  workflow_dispatch:

permissions:
  issues: write

jobs:
  stale:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/stale@v10
        with:
          stale-issue-message: 'This issue has been automatically marked as stale because it has not had activity in 60 days. It will be closed in 14 days if no further activity occurs.'
          stale-issue-label: 'stale'
          days-before-stale: 60
          days-before-close: 14
          exempt-issue-labels: 'P0-blocker,P1-critical,status:blocked'
          operations-per-run: 30
