name: Close stale issues
on:
  schedule:
    - cron: '50 1 * * *'

jobs:
  stale:
    runs-on: ubuntu-latest
    permissions:
      issues: write
      pull-requests: write
    steps:
      - uses: actions/stale@v8
        with:
          days-before-issue-stale: 90
          days-before-pr-stale: -1
          days-before-issue-close: 7
          # days-before-pr-close: 10

          stale-issue-label: "status:stale"
          stale-pr-label: "status:stale"

          exempt-issue-labels: >
            status:idea,
            status:planning,
            status:on hold,
            status:ready,
            type:bug,
            type:docs,
            type:enhancement,
            type:feature,
            type:refactor,
            type:task,

          stale-issue-message: >
            This issue has been automatically marked as stale because it has not had
            recent activity. It will be closed if no further activity occurs. Thank you
            for your contributions.
          close-issue-message: >
            This issue was closed because it has been stalled for 7 days with no activity.
