tespkg / actions-cache

Cache to S3 storage with official actions/cache@v2 fallback
MIT License
75 stars 31 forks source link

Add an action output for cache size #30

Closed tvthatsme closed 1 year ago

tvthatsme commented 1 year ago

Changes

I'm seeing some cache-hits that are basically empty?

Cache Size: 22bytes (22 bytes)
/usr/bin/tar --use-compress-program zstd -d -xf /runner/_work/_temp/051fd982-919c-487f-bb71-d[18](https://github.com/.../actions/runs/5405282943/jobs/9821288693#step:4:19)260fde93d/cache.tzst -P -C /runner/_work/...
Cache restored from s3 successfully

22 bytes when something like 537680268 bytes are really expected...

This leads to a positive cache hit and the rest of my workflow continues as if the cache object has been restored when it really wasn't in the s3 bucket at all. Later in the workflow everything fails when if I had known the hit was incorrect, I could have build the asset in the workflow.

These changes add a cache-size output to the action so that other steps can decide if they want to trust a cache hit.

Fix Issues

jackieli-tes commented 1 year ago

Hi, Thanks, this looks simple and straight forward improvement.

tvthatsme commented 1 year ago

Hey @jackieli-tes thanks for merging this! Would you mind cutting a release so that we could start using it?