name: Close inactive issues
on:
  schedule:
    - cron: "30 1 * * *"

jobs:
  close-issues:
    runs-on: ubuntu-latest
    permissions:
      issues: write
      pull-requests: write
    steps:
      - uses: actions/stale@v5
        with:
          days-before-stale: -1
          days-before-pr-close: -1
          days-before-issue-close: 21
          close-issue-message: "This issue was closed because it has been inactive for 21 days. Reopen it or create a new issue in case the problem still persists."
