Skip to content

f#25

Open
stupidloud wants to merge 33 commits intotestfrom
main
Open

f#25
stupidloud wants to merge 33 commits intotestfrom
main

Conversation

@stupidloud
Copy link
Copy Markdown
Owner

No description provided.

@stupidloud stupidloud force-pushed the main branch 5 times, most recently from 13d80cf to 21a40ca Compare March 28, 2025 20:42
HiGarfield and others added 8 commits February 15, 2026 03:50
Co-authored-by: HiGarfield <32226909+HiGarfield@users.noreply.github.com>
…match

When a cache is found via a restore key (prefix match) instead of the
exact primary key, CACHE_STATE should NOT be set to "hit".  Previously,
any hit — including a partial/restore-key match — set the state, causing
save.js to skip saving the updated ccache content after a build.

Now CACHE_STATE is only set to "hit" when cacheFetchingResult === keyString
(exact primary-key match), so ccache is correctly saved after every build
even when a previous cache was restored via the fallback restore key.

Agent-Logs-Url: https://github.com/HiGarfield/cachewrtbuild/sessions/d095a004-01ae-47c6-94fd-826723eff894

Co-authored-by: HiGarfield <32226909+HiGarfield@users.noreply.github.com>
@actions/cache.saveCache() returns -1 (not undefined/0) when the save
fails (e.g. ReserveCacheError because the key already exists).  Because
-1 is truthy in JavaScript, the previous `if (cacheId)` guard incorrectly
logged "Cache saved with key: ... (id: -1)" on every such failure.

Use `cacheId !== -1` to correctly distinguish a successful save
(positive integer ID) from a failed one (-1).

Agent-Logs-Url: https://github.com/HiGarfield/cachewrtbuild/sessions/d095a004-01ae-47c6-94fd-826723eff894

Co-authored-by: HiGarfield <32226909+HiGarfield@users.noreply.github.com>
Prefer > -1 over !== -1 to guard against any negative return value,
not just exactly -1.

Agent-Logs-Url: https://github.com/HiGarfield/cachewrtbuild/sessions/d095a004-01ae-47c6-94fd-826723eff894

Co-authored-by: HiGarfield <32226909+HiGarfield@users.noreply.github.com>
error.message is undefined when the thrown value is not an Error object
(e.g. a plain string or number).  Use the pattern
  error instanceof Error ? error.message : String(error)
in both fetch.js (core.setFailed) and save.js (core.warning) so that
any thrown value produces a meaningful failure/warning message.

Agent-Logs-Url: https://github.com/HiGarfield/cachewrtbuild/sessions/130dfcbb-449a-4a4b-903c-aa57ffc5280d

Co-authored-by: HiGarfield <32226909+HiGarfield@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants