Clean Workflow Logs #24
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: Clean Workflow Logs | |
on: | |
schedule: | |
- cron: "0 0 * * 0" # Runs "At 00:00 on Sunday." (see https://crontab.guru) | |
workflow_dispatch: | |
inputs: | |
runs_older_than: | |
description: "The amount of days old to delete" | |
default: "30" | |
required: false | |
runs_to_keep: | |
description: "The amount of latest workflows runs to keep" | |
default: "10" | |
required: false | |
env: | |
SCHEDULED_RUNS_OLDER_THAN: "30" | |
SCHEDULED_RUNS_TO_KEEP: "10" | |
jobs: | |
clean-logs: | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
steps: | |
- uses: igorjs/gh-actions-clean-workflow@v6 | |
with: | |
runs_older_than: ${{ github.event.inputs.runs_older_than || env.SCHEDULED_RUNS_OLDER_THAN }} | |
runs_to_keep: ${{ github.event.inputs.runs_to_keep || env.SCHEDULED_RUNS_TO_KEEP }} |