Bump @actions/cache to 5.1.0, handle cache write denied#1026
Open
jasongin wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request updates setup-java’s dependency caching behavior by bumping @actions/cache to v5.1.0 and adjusting the action’s post-step cache save logic so it no longer reports a successful save when the cache library returns -1 (e.g., write denied with read-only tokens or reserve collisions).
Changes:
- Bump
@actions/cacheto^5.1.0and update the action version to5.3.0(including lockfile). - Update
src/cache.tsto treatsaveCache()returning-1as “not saved” (debug-log + early return) rather than logging a successful save. - Regenerate
distartifacts, update the Licensed dependency record, and adjust tests to cover the-1return path.
Show a summary per file
| File | Description |
|---|---|
| src/cache.ts | Avoids logging “Cache saved…” when @actions/cache.saveCache() returns -1 (not saved). |
| package.json | Bumps action version to 5.3.0 and updates @actions/cache dependency to ^5.1.0. |
| package-lock.json | Updates lockfile to reflect @actions/cache@5.1.0 and version 5.3.0. |
| dist/setup/index.js | Updates bundled output to include new cache write-denied handling and regenerated artifacts. |
| dist/cleanup/index.js | Updates bundled output to match regenerated cache handling behavior. |
| .licenses/npm/@actions/cache.dep.yml | Updates Licensed metadata for @actions/cache to 5.1.0. |
| tests/cache.test.ts | Updates/extends coverage for the saveCache() => -1 “not saved” behavior (debug log, no “saved” info log). |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/7 changed files
- Comments generated: 0
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.
Description:
@actions/cacheto v5.1.0 to pick up actions/toolkit#2435 Handle cache write error due to read-only tokencache.tsdistCheck list: