name: Manage stale activities

on:
  schedule:
  - cron: '0 10 * * *'

jobs:
  stale:

    runs-on: ubuntu-latest
    permissions:
      issues: write
      pull-requests: write

    steps:
    - uses: actions/stale@v9
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        days-before-stale: 90
        stale-issue-message: 'This issue was marked as staled automatically because it has not seen any activity in 90 days'
        stale-pr-message: 'This pull request was marked as staled automatically because it has not seen any activity in 90 days'
        stale-issue-label: 'stale'
        stale-pr-label: 'stale'
        days-before-close: 3650
        close-issue-label: 'closed-as-stale'
        close-pr-label: 'closed-as-stale'
        close-issue-message: 'This issue was closed automatically because it has not seen any activity in 365 days'
        close-pr-message: 'This pull request was closed automatically because it has not seen any activity in 365 days'
