name: Mark Stale Issues and PRs

on:
  schedule:
    - cron: "0 0 * * 1"  # Every Monday at midnight
  workflow_dispatch:

permissions:
  issues: write
  pull-requests: write

jobs:
  stale:
    runs-on: self-hosted
    steps:
    - name: Mark stale issues and PRs
      uses: actions/stale@v8
      with:
        repo-token: ${{ secrets.GITEA_TOKEN }}
        days-before-stale: 30
        days-before-close: 14
        stale-issue-label: "stale"
        stale-pr-label: "stale"
        stale-issue-message: |
          This issue 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.
          Thank you for your contributions!
        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.
          Thank you for your contributions!
        exempt-issue-labels: "pinned,security,help wanted,good first issue"
        exempt-pr-labels: "pinned,security,help wanted,good first issue"
