Skip to content

ci(actions-caches): add daily cleaner for closed-PR pre-commit caches#7034

Merged
xmfcx merged 1 commit intomainfrom
ci/cleanup-actions-caches
Apr 20, 2026
Merged

ci(actions-caches): add daily cleaner for closed-PR pre-commit caches#7034
xmfcx merged 1 commit intomainfrom
ci/cleanup-actions-caches

Conversation

@xmfcx
Copy link
Copy Markdown
Contributor

@xmfcx xmfcx commented Apr 18, 2026

  • Adds .github/workflows/cleanup-actions-caches.yaml, a tiny daily workflow that lists pre-commit* Actions caches and deletes any whose attached PR is no longer open.
  • Runs on schedule: 30 5 * * * (05:30 UTC) and on workflow_dispatch. Logs each cache decision and writes a markdown summary to $GITHUB_STEP_SUMMARY.

Why

GitHub's default cache LRU only evicts after 7 days of no access, so caches keyed to closed/merged PRs sit around uselessly. Today they are small (~430 MiB across 10 entries), but the cost is zero to keep them tidy and it scales as PR throughput grows.


Test plan

  • Manually dispatch the workflow from the Actions tab and confirm it completes green.

  • Inspect the run's Summary for the 🧹 Pre-commit cache cleanup table (scanned / deleted / remaining counts).

  • Expand the 🗂️ Inspecting per-PR state group and confirm OPEN PRs are marked ⏭️ keep and CLOSED/MERGED ones 🗑️ delete.

  • After the run, verify deletions locally:

    gh cache list --repo autowarefoundation/autoware --limit 100 --key pre-commit \
      --json ref,key,sizeInBytes,createdAt

    Confirm no entries remain whose ref matches a closed PR.

@xmfcx xmfcx self-assigned this Apr 18, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 18, 2026

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

GitHub Actions caches keyed to closed/merged PRs linger up to 7 days
under the default LRU. Add a small daily workflow that lists pre-commit
caches and deletes any whose attached PR is no longer open.

Signed-off-by: Mete Fatih Cırıt <[email protected]>
@xmfcx xmfcx force-pushed the ci/cleanup-actions-caches branch from 8642f79 to 1246910 Compare April 20, 2026 07:57
@xmfcx xmfcx merged commit bbd778a into main Apr 20, 2026
14 checks passed
@xmfcx xmfcx deleted the ci/cleanup-actions-caches branch April 20, 2026 10:53
@xmfcx
Copy link
Copy Markdown
Contributor Author

xmfcx commented Apr 20, 2026

Cute 🎀

image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run:health-check Run health-check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants