|
--- |
|
name: autoclose schedule |
|
# Autoclose PRs labeled with "status: autoclose candidate" after 2 weeks. |
|
# Based on scikit-learn's implementation at |
|
# https://github.com/scikit-learn/scikit-learn/blob/main/.github/workflows/autoclose-schedule.yml |
|
|
|
permissions: |
|
contents: read |
|
pull-requests: write |
|
|
|
on: |
|
schedule: |
|
- cron: '0 2 * * *' # runs daily at 02:00 UTC |
|
workflow_dispatch: |
|
|
|
env: |
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
|
|
jobs: |
|
|
|
autoclose: |
|
name: autoclose labeled PRs |
|
runs-on: ubuntu-latest |
|
steps: |
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
|
with: |
|
persist-credentials: false |
|
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 |
|
with: |
|
python-version: '3.13' |
|
- name: Install PyGithub |
|
run: pip install -Uq PyGithub |
|
|
|
- name: Close PRs labeled more than 14 days ago |
|
run: | |
|
python tools/autoclose_prs.py |