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:
2026-08-14 23:28:31 +08:00
parent 43f1755c0e
commit 8cdec4603c
2 changed files with 16 additions and 1 deletions
+3
View File
@@ -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