name: close stale issues and pr
on:
  schedule:
    - cron: "30 1 * * *"
  workflow_dispatch:

jobs:
  close-issues:
    if: github.repository_owner == 'pylint-dev'
    runs-on: ubuntu-latest
    permissions:
      issues: write
      pull-requests: write
    steps:
      - uses: actions/stale@v9
        with:
          days-before-issue-stale: 28
          days-before-issue-close: 7
          any-of-issue-labels:
            "Waiting on author,Cannot reproduce 🤷,python past end of life,Won't fix/not
            planned"
          exempt-issue-labels: "High priority,Blocked 🚧,Needs decision 🔒"
          stale-issue-message:
            "This issue is stale because it has been open 4 weeks with no activity.
            Remove 'Stale' label or comment or this will be closed in a week."
          close-issue-message:
            "This issue was closed because it has been stalled for five weeks with no
            activity."

          any-of-pr-labels:
            "Waiting on author,python past end of life,Won't fix/not planned"
          exempt-pr-labels: "High priority,Blocked 🚧,Needs review 🔍"
          days-before-pr-stale: 56
          days-before-pr-close: -1
          stale-pr-label: "Needs take over 🛎️"
          close-pr-message:
            "This PR was closed because it needed to be taken over for 16 weeks with no
            one stepping up."
          stale-pr-message:
            "This PR needs take over because because it has been open 8 weeks with no
            activity."
