name: Close Stale Pull Requests
permissions: read-all

on:
  schedule:
    - cron: '0 2 * * *'
  workflow_dispatch:

jobs:
  stale:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
      - uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 # v10.3.0
        with:
          days-before-pr-stale: 60
          days-before-pr-close: 14
          stale-pr-label: stale
          stale-pr-message: >
            This pull request has been automatically marked as stale because it has not had
            recent activity. It will be closed if no further activity occurs within 14 days.
          close-pr-message: >
            This pull request has been automatically closed due to inactivity.
            Please feel free to reopen it if you would like to continue working on it.
          days-before-issue-stale: -1
          days-before-issue-close: -1
