Open
Conversation
fix github actions warning: Node.js 12 actions are deprecated.
update to Node.js 16
update node modules
update to Node.js 20 and update node modules
update node modules
improve code and update node modules
13d80cf to
21a40ca
Compare
…d guards Co-authored-by: HiGarfield <32226909+HiGarfield@users.noreply.github.com> Agent-Logs-Url: https://github.com/HiGarfield/cachewrtbuild/sessions/b6c68633-68f8-4d69-b554-894c31229c91
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>
Update to Node.js 24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.