Skip to content

Clear cache weekly #129

Clear cache weekly

Clear cache weekly #129

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 }}