9. Delete old workflow runs #18
This file contains 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: "9. Delete old workflow runs" | |
on: | |
schedule: | |
# Run monthly, at 00:00 on the 1st day of month. | |
# https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07 | |
- cron: '0 0 1 * *' | |
# Allow manual triggering | |
workflow_dispatch: | |
inputs: | |
retain_days: | |
description: 'Delete runs older than this many days' | |
required: true | |
type: number | |
default: 30 | |
min_runs: | |
description: 'Minimum runs to keep' | |
required: true | |
type: number | |
default: 20 | |
jobs: | |
delete_runs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Delete old workflow runs" | |
uses: Mattraks/delete-workflow-runs@v2 | |
with: | |
token: ${{ github.token }} | |
repository: ${{ github.repository }} | |
retain_days: ${{ inputs.retain_days || 30 }} | |
keep_minimum_runs: ${{ inputs.min_runs || 20 }} |