name: Stale

# yamllint disable-line rule:truthy
on:
  schedule:
    - cron: "0 9 * * 5"
  workflow_dispatch:

jobs:
  stale:
    runs-on: ubuntu-latest
    steps:
      # The 90 day stale policy
      # Used for:
      # - Issues & PRs
      # - No PRs marked as no-stale
      # - No issues marked as no-stale or help-wanted
      - name: 90 days stale issues & PRs policy
        uses: actions/stale@v10
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          days-before-stale: 90
          days-before-close: 7
          operations-per-run: 150
          remove-stale-when-updated: true
          stale-issue-label: "stale"
          exempt-issue-labels: "no-stale,💡 feature request,🙋‍♂️ help wanted,🏗 in progress,👩‍💻 needs testing,🐜 bug"
          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.
            Please make sure to update to the latest version of xknx (or Home Assistant) and
            check if that solves the issue. Let us know if that works for you by
            adding a comment 👍
            This issue has now been marked as stale and will be closed if no
            further activity occurs. Thank you for your contributions.
          stale-pr-label: "stale"
          exempt-pr-labels: "no-stale,🙋‍♂️ help wanted,🏗 in progress,👩‍💻 needs testing,🐜 bug"
          stale-pr-message: >
            There hasn't been any activity on this pull request recently. This
            pull request has been automatically marked as stale because of that
            and will be closed if no further activity occurs within 7 days.
            Thank you for your contributions.
