Cleanup Old Workflow Runs #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |