Clear cache weekly #127
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: Clear cache weekly | |
on: | |
schedule: | |
# on Sunday's night 2am | |
- cron: "0 2 * * 0" | |
pull_request: | |
paths: | |
- ".github/scripts/find-unused-caches.py" | |
- ".github/scripts/find-unused-caches.txt" | |
- ".github/workflows/cleanup-caches.yml" | |
- ".github/workflows/cron-clear-cache.yml" | |
workflow_dispatch: | |
inputs: | |
pattern: | |
description: "pattern for cleaning cache" | |
default: "pip" | |
required: false | |
type: string | |
age-days: | |
description: "setting the age of caches in days to be dropped" | |
required: true | |
type: number | |
default: 7 | |
jobs: | |
drop-unused-caches: | |
uses: ./.github/workflows/cleanup-caches.yml | |
with: | |
scripts-ref: ${{ github.sha }} # use local version | |
dry-run: ${{ github.event_name == 'pull_request' }} | |
# ise input if set of default... | |
pattern: ${{ inputs.pattern || 'pip|conda' }} | |
age-days: ${{ fromJSON(inputs.age-days) || 2 }} |