name: 'Close stale issues'
on:
  workflow_dispatch:
  schedule:
    # 1:30am every day
    - cron: '30 1 * * *'

permissions:
  issues: write

jobs:
  stale:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/stale@5ebf00ea0e4c1561e9b43a292ed34424fb1d4578 # tag: v6.0.1
        with:
          days-before-stale: 90
          days-before-close: 30
          stale-issue-label: stale
          operations-per-run: 1750
          stale-issue-message: >
            This issue has been automatically marked as stale. **If this issue is still affecting you, please leave any comment** (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the [latest version of Electron](https://www.electronjs.org/releases/stable) or in the [beta](https://www.electronjs.org/releases/beta)—please include it with your comment!
          close-issue-message: >
            This issue has been closed due to inactivity, and will not be monitored.  If this is a bug and you can reproduce this issue on a [supported version of Electron](https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline) please open a new issue and include instructions for reproducing the issue.
          exempt-issue-labels: "discussion,security \U0001F512,enhancement :sparkles:"
          only-pr-labels: not-a-real-label
  pending-repro:
    runs-on: ubuntu-latest
    if: ${{ always() }}
    needs: stale
    steps:
      - uses: actions/stale@5ebf00ea0e4c1561e9b43a292ed34424fb1d4578 # tag: v6.0.1
        with:
          days-before-stale: -1
          days-before-close: 10
          stale-issue-label: blocked/need-repro
          stale-pr-label: not-a-real-label
          operations-per-run: 1750
          close-issue-message: >
            Unfortunately, without a way to reproduce this issue, we're unable to continue investigation. This issue has been closed and will not be monitored further. If you're able to provide a minimal test case that reproduces this issue on a [supported version of Electron](https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline) please open a new issue and include instructions for reproducing the issue.
