name: Nightly maintenance

on:
  schedule:
    - cron: "17 2 * * *"
    - cron: "17 14 * * 0"
  workflow_dispatch:
    inputs:
      dry-run:
        description: Report only, change nothing
        type: boolean
        default: true
      scope:
        description: Which caches to sweep
        type: choice
        default: stale
        options: [stale, all]

permissions:
  contents: read
  actions: write

jobs:
  sweep:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: echo "dry-run=${{ inputs.dry-run }} scope=${{ inputs.scope }}"
