mirror of
https://github.com/storytold/figcraft.git
synced 2026-12-03 15:31:21 -05:00
35 lines
1.1 KiB
YAML
35 lines
1.1 KiB
YAML
name: Cache prune
|
|
|
|
# Deletes main's dependency-cache entries that a newer entry replaced (after a toolchain or
|
|
# lockfile update) and no run has used since, so the repository stays within its 10 GB Actions
|
|
# cache budget, where GitHub evicts entries a run still needs. It runs once after every main CI
|
|
# attempt, re-runs of failed jobs and canceled runs included (craft-common-actions
|
|
# actions/cache-prune).
|
|
on:
|
|
workflow_run:
|
|
workflows: [CI]
|
|
types: [completed]
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
cache-prune:
|
|
name: cache prune
|
|
# A fork's pull request from a branch named main also matches `branches`.
|
|
if: github.event.workflow_run.event != 'pull_request'
|
|
timeout-minutes: 10
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
actions: write
|
|
steps:
|
|
- name: Harden runner
|
|
uses: step-security/harden-runner@v2.23.0
|
|
with:
|
|
egress-policy: audit
|
|
# A failed pass warns; the next run's prune deletes what it missed.
|
|
- name: Prune replaced cache entries
|
|
uses: storytold/craft-common-actions/actions/cache-prune@main
|
|
continue-on-error: true
|