name: Manage Stale Issues

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:
          repo-token: ${{ secrets.GITHUB_TOKEN }}

          # Issue settings
          stale-issue-message: >
            This issue has been automatically marked as stale because it has not had
            recent activity. It will be closed in 14 days if no further activity occurs.
            Thank you for your contribution! 🥚
          stale-issue-label: 'stale'
          days-before-issue-stale: 60
          days-before-issue-close: 14
          exempt-issue-labels: 'pinned,security,bug,enhancement'

          # PR settings
          stale-pr-message: >
            This pull request has been automatically marked as stale because it has not had
            recent activity. It will be closed in 14 days if no further activity occurs.
            Thank you for your contribution! 🐣
          stale-pr-label: 'stale'
          days-before-pr-stale: 45
          days-before-pr-close: 14
          exempt-pr-labels: 'pinned,security,work-in-progress'

