actions / cache

Cache dependencies and build outputs in GitHub Actions
MIT License
4.37k stars 1.16k forks source link

Large Cache Usage for Merge Queue #1243

Closed alex-statsig closed 3 months ago

alex-statsig commented 10 months ago

I noticed that with merge queue, caches using the actions/cache@v3 action are created against a temporary merge queue branch (ex. gh-readonly-queue/main/pr-14892-cde4f804768429dfc01d6dc38f50d0439b0eb292). These caches will never be used again (since caches can only use the current branch or base branch, no other run should be able to use it). However, they fill our cache and cause the actually important caches to be evicted (our repo is constantly at 20+GB / 10GB, filled with a bunch of 300MB node_module caches that never get re-used).

We could address this by checking if the action is merge-queue-related, and use actions/cache/restore instead of actions/cache, but this would be extremely tedious and repetitive (~5 caches per workflow across 10 workflows = 50 places we have to duplicate cache/restore keys).

Could the action be updated to automatically not save the cache if the trigger is merge_group or the branch is gh-readonly-queue or something to this effect?

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.

github-actions[bot] commented 3 months ago

This issue was closed because it has been inactive for 5 days since being marked as stale.