name: Mark stale issues

on:
  schedule:
    - cron: '0 8 * * *'
  workflow_dispatch:

jobs:
  stale:

    runs-on: ubuntu-latest
    permissions:
      issues: write

    steps:
      - uses: actions/stale@v5.2.0
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          days-before-stale: 30
          days-before-close: 5
          stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.'
          stale-issue-label: 'stale'
          exempt-issue-labels: 'Internal, Fixed in next release, Bug: Confirmed, Documentation Needed'
          exempt-all-issue-assignees: true
          operations-per-run: 300
          close-issue-reason: 'not_planned'