name: Close stale issues and pull requests

on:
  workflow_dispatch:
  schedule:
    - cron: '0 0 * * *' # Run every day at midnight

jobs:
  stale:
    permissions:
      issues: write
      pull-requests: write
    runs-on: ubuntu-latest
    steps:
      - uses: actions/stale@v11
        with:
          days-before-stale: 30
          days-before-pr-stale: -1
          exempt-issue-labels: in-progress,help-wanted,pinned,security,enhancement
          remove-issue-stale-when-updated: true
