Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.
/ always-cache Public archive

"Live patching" of `actions/cache@v3` to let it always cache

License

Notifications You must be signed in to change notification settings

Olf0/always-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

"Live patching" of actions/cache@v3 to let it always cache

GitHub's action actions/cache@v3 only saves data in the cache, if the job succeeds. There has been much interest in letting actions/cache save data in the cache even if the job fails, see its issue #92.
Note that GitHub has provided an alternative solution by releasing two new actions actions/cache/save and actions/cache/restore in December 2022, but this requires significant changes to extant workflows which use GitHub's classic actions/cache, plus all three actions continue to be maintained by GitHub (so it was indicated in this "Conclusion"). Still this extension of the original "action cache, which is structurally analog to actions/cache/save and actions/cache/restore, continues to provide a larger feature set!

Rather than forking and adapting GitHub's actions/cache, which creates a maintenance burden, this repository demonstrates "live patching" of the original actions/cache@v3 on every job run to accomplish this goal, see .github//actions/cache-always/action.yml. It does …

Ultimately one simply substitutes all occurrences of actions/cache@v3 with Olf0/cache-always@v3.
Alternatively one copies .github/actions/cache-always/action.yml from this repository directly to the same location of one's own repository and uses it in one's own workflows in .github/workflows instead of the original actions/cache@v3.

For an example of a workflow using the "live patched" actions/cache@v3 in .github/actions/cache-always see .github/workflows/demo-cache-always.yml.

P.S.: Special thanks to user DrJume for the enhancements of the original version here: These have been integrated and further improved.

About

"Live patching" of `actions/cache@v3` to let it always cache

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published