name: Stale Bot

on:
  schedule:
    - cron: "0 15 * * *"

permissions: {}

jobs:
  close_stale_issues:
    name: Close Stale Issues
    if: github.repository == 'huggingface/peft'
    runs-on: ubuntu-latest
    permissions:
      issues: write
      pull-requests: write
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    steps:
    - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8  # v5.0.0
      with:
        persist-credentials: false

    - name: Setup Python
      uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c  # v6.0.0
      with:
        python-version: 3.11

    - name: Install requirements
      run: |
        pip install PyGithub
    - name: Close stale issues
      run: |
        python scripts/stale.py
