Skip to content

Cleanup Old Workflow Runs #2

Cleanup Old Workflow Runs

Cleanup Old Workflow Runs #2

name: Cleanup Old Workflow Runs
permissions:
actions: write
contents: read
on:
schedule:
- cron: '0 0 * * 0' # Run weekly on Sunday
workflow_dispatch: # Allow manual trigger
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Delete old workflow runs (including this workflow)
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 30
keep_minimum_runs: 3 # Keep at least 3 recent runs of each workflow