Restore into the path input, not the archive's embedded absolute path
Restore only used the path input for a redundant mkdir and then extracted to / using the absolute path baked into the archive, which pointed at the stale per-run workspace of whichever run saved it. Extract relative archives (<basename>/...) into the parent of the requested path; keep a legacy fallback (extract to /) for old archives, which report cache-hit only when the requested path actually gains content.
This commit is contained in:
@@ -24,6 +24,9 @@ A Gitea Action that caches build files as `tar.xz` archives on the runner filesy
|
||||
3. Restores by extracting the archive to `/`, saves by creating one
|
||||
4. Touches the archive on every hit, so the retention policy can expire by
|
||||
last use
|
||||
5. Archives store the cached directory **relative** (`<basename>/...`), not its
|
||||
absolute path — a later run restores into its own `path` location, so the
|
||||
cache works across runs even though each run gets a fresh workspace
|
||||
|
||||
## Cache Retention
|
||||
|
||||
|
||||
Reference in New Issue
Block a user