name: "Close stale issues"

on:
  schedule:
    - cron: "30 1 * * *"

jobs:
  stale:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          days-before-stale: 21
          days-before-close: 7

          # Milestones on an issue or a PR exempted from being marked as stale.
          exempt-milestones: true
          # Exempt all issues with milestones from being marked as stale.
          exempt-all-issue-milestones: true

          # Only check issues and PRs with these labels
          any-of-labels: "x:status/claimed,claimed 🐾,dependencies,do not merge 🚧,duplicate,experimental 🔬,
            first-timers only 🐣,github_actions,good first issue,good first patch,hacktoberfest 🍁,
            hacktoberfest-accepted ☑,in-progress 🌿,invalid,python,security 🚨, wip/content-checking  ☑,
            wip/proof-reading 👀,wip/story-writing  ✍,wip/style-guideline-checking 📐,spam 🚫,status/draft,
            status/wontfix  🙅🏽"
          stale-issue-label: abandoned 🏚
          stale-issue-message: >
            This issue has been automatically marked as `abandoned 🏚`
            because it has not had recent activity. It will be closed if no
            further activity occurs. Thank you
            for your contributions.
          close-issue-message: >
            Closing stale issue. If this issue is still relevant,
            please reopen it.
          stale-pr-label: 'abandoned 🏚'
          stale-pr-message: >
            This pull request has been automatically marked as `abandoned 🏚`
            because it has not had recent activity. It will be closed if no
            further activity occurs. Thank you for your contributions.
          close-pr-message: >
            Closing stale pull request. If you are still working on this,
            please reopen this pull request.
