Cleanup Old Workflow Runs #14
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 | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 0' # Every Sunday at midnight UTC | |
| workflow_dispatch: | |
| inputs: | |
| days_before: | |
| description: 'The number of days before today' | |
| required: false | |
| type: string | |
| default: '7' | |
| permissions: | |
| actions: write | |
| jobs: | |
| cleanup: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clean old workflow runs | |
| uses: igorjs/gh-actions-clean-workflow@v6 | |
| with: | |
| runs_older_than: ${{ inputs.days_before || '7' }} # Delete runs older than specified days (default: 7) |