Adding "always-save" flag to make #840 easier
The current recommendation has been a bit difficult for me to understand (and it seems i am not the only one?).
In this PR I implemented a always-save flag that makes this easier for me to understand.
Hoping this is a major priority!
I desperately need this feature.
My use case:
- I need to access large amounts of data that is hosted in another git repository.
- I clone the repository (if it doesn't exist) or do a git pull, if it exists, essentially keeping my cache up-to-date with the repository.
- With the current implementation, it assumes that the cache is immutable, so I have to invalidate the entire cache every time there's a change in the other repository, essentially running
git cloneon every cache invalidation (I'm using as cache key the commit SHA of the remote repo's HEAD). The behavior I would like is to have a persistent cache and rungit pullin it and save the resulting cache, therefore analways-saveoption would work very well for me.
With the current approach of immutable cache, every time there's a small change in the remote repo, I have to invalidate the entire cache and download it all again, even if it's a one-line change that would be way cheaper with a git pull and subsequently updating the cache.
LGTM.
@bishal-pdMSFT are you going to review or give an answer?
We have released two new actions actions/cache/restore and actions/cache/save that take care of this case as well. You can now choose to run save action with condition if: always() and it will always save the cache for you for the given key.
We had released a beta to get user's feedback, discussion post here. And release post here.
Closing this as the use case as been implemented.