name: 'Close stale issues and PRs'

on:
  schedule:
    - cron: '30 1 * * *'
  workflow_dispatch:

permissions:
  issues: write
  pull-requests: write

jobs:
  stale:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/stale@v9
        with:
          stale-issue-message: >
            This issue has been automatically marked as stale because it has not had
            recent activity for 2 years. It will be closed if no further activity occurs
            within 30 days. Thank you for your contributions! 🦊
          stale-pr-message: >
            This pull request has been automatically marked as stale because it has not had
            recent activity for 2 years. It will be closed if no further activity occurs
            within 30 days. Thank you for your contributions! 🦊
          close-issue-message: >
            This issue was closed because it has been stale for 30 days with no further activity.
            Feel free to reopen if this is still relevant! 🐲
          close-pr-message: >
            This pull request was closed because it has been stale for 30 days with no further activity.
            Feel free to reopen if this is still relevant! 🐲
          days-before-stale: 730
          days-before-close: 30
          stale-issue-label: 'stale'
          stale-pr-label: 'stale'
          exempt-issue-labels: 'pinned,security,good first issue'
          exempt-pr-labels: 'pinned,security'
