name: Close stale issues and PRs

on:
  schedule:
    - cron: '0 0 * * *' # Daily

jobs:
  stale:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/stale@v7
        with:
          days-before-stale: 30
          days-before-close: 7
          stale-issue-message: 'This issue has been automatically marked as stale due to inactivity.'
          stale-pr-message: 'This PR has been automatically marked as stale due to inactivity.'
          close-issue-message: 'Closing this issue due to prolonged inactivity.'
          close-pr-message: 'Closing this PR due to prolonged inactivity.'
          exempt-issue-labels: 'keep-open'
          exempt-pr-labels: 'keep-open'
          only: 'pulls'
