name: Stale bot

on:
  workflow_dispatch:
  schedule:
  - cron: "44 */2 * * *"

permissions:
  contents: read

jobs:
  stale:
    runs-on: ubuntu-latest
    permissions:
      issues: write
      pull-requests: write

    steps:
    - uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84 # v8.0.0
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        days-before-stale: 6
        days-before-close: 7
        only-labels: 'Status: Requires Reporter Clarification'
        stale-issue-label: 'stale'
        stale-pr-label: 'stale'
        operations-per-run: 999
        stale-issue-message: >
          This issue is labeled as requiring an update from the reporter, and no update has been received
          after 6 days.  If no update is provided in the next 7 days, this issue will be automatically closed.
        stale-pr-message: >
          This PR is labeled as requiring an update from the reporter, and no update has been received
          after 6 days.  If no update is provided in the next 7 days, this issue will be automatically closed.
