Skip to content

Feat: Control whether caches are written #1570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
helly25 opened this issue Mar 11, 2025 · 2 comments
Open

Feat: Control whether caches are written #1570

helly25 opened this issue Mar 11, 2025 · 2 comments

Comments

@helly25
Copy link

helly25 commented Mar 11, 2025

In some cases you want to read but not save a new cache. For instance when you run workflows on a tag action, then you probably want to read caches from the main/default branch, but you most likely do not want to create new caches. The current solution is to separate restore and save actions which is cumbersome.

In #1452 the always_save feature was removed.

I propose to add a new config save-on-success that defaults to true and can be set false to prevent cache writing. Now this new value can be set from available context - just like you could when separating the steps - granted the decision must be available upfront. That above described decision is in fact available immediately on job creation. So we can use the new setting to simplify the setup.

helly25 added a commit to helly25/cache that referenced this issue Mar 11, 2025
@helly25
Copy link
Author

helly25 commented Mar 11, 2025

A proposal to implement this is in #1571

helly25 added a commit to helly25/cache that referenced this issue Apr 25, 2025
@helly25
Copy link
Author

helly25 commented Apr 25, 2025

See also https://github.com/actions/cache/discussions/1598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant