32 lines
798 B
YAML
32 lines
798 B
YAML
name: Cleanup Old Workflows
|
|
|
|
on:
|
|
schedule:
|
|
# Run weekly on Sunday at 00:00
|
|
- cron: '0 0 * * 0'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
cleanup:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install requests
|
|
|
|
- name: Cleanup old workflow runs
|
|
env:
|
|
TOKEN: ${{ secrets.PAT }}
|
|
run: |
|
|
python scripts/cleanup_workflows.py $TOKEN
|