Skip to content

Bump @actions/cache to v6.1.0 - handle read-only cache access - #1768

Merged
danwkennedy merged 1 commit into
actions:mainfrom
jasongin:readonly-cache
Jun 23, 2026
Merged

danwkennedy merged 1 commit into
actions:mainfrom
jasongin:readonly-cache

Conversation

@jasongin

@jasongin jasongin commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • Bump @actions/cache to v6.1.0 to pick up actions/toolkit#2435 Handle cache write error due to read-only token
  • Switch redundant "Cache save failed" warning to debug log in save-only
  • Add a section in README.md about read-only cache access
  • Update generated JavaScript files under dist
  • Update license files for dependencies
  • Bump minor version in package.json from 6.0.0 to 6.1.0

Motivation and Context

The Actions service will soon issue tokens with read-only cache access to certain lower-trust worfklows such as pull_request_target. (Until now, read-write cache access was always granted.) Without this fix, the cache actions do not propagate errors from the service when attempting to write to the cache, resulting in a misleading warning message emitted to the workflow log: "Unable to reserve cache with key ${key}, another job may be creating this cache." After this change, the correct "cache write denied" warning will be emitted instead when that happens.

How Has This Been Tested?

  • The @actions/cache change in the toolkit repo included updated unit tests.
  • I ran end-to-end workflows with read-only cache tokens along with the changes in this PR and observed the resulting warnings emitted to the workflow log.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (add or update README or docs)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copilot AI review requested due to automatic review settings June 18, 2026 20:01
@jasongin
jasongin requested a review from a team as a code owner June 18, 2026 20:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates this action to @actions/cache@5.1.0 to correctly surface “cache write denied” behavior when the workflow token has read-only cache permissions, reduces redundant warning noise in the save-only variant, and documents the new behavior.

Changes:

  • Bump @actions/cache dependency and action version to 5.1.0
  • Change save-only behavior to log a debug message (instead of an extra warning) when the cache is not saved
  • Document read-only cache access behavior in the README and update release notes / license metadata
Show a summary per file
File Description
src/saveImpl.ts Avoids emitting a generic warning in save-only when saveCache returns -1; uses core.debug instead.
__tests__/saveOnly.test.ts Updates expectations to assert debug logging and no warning / failure when save resolves to -1.
README.md Adds a “Read-only access” section explaining restore-vs-save behavior with read-only tokens.
RELEASES.md Adds a 5.1.0 changelog entry and minor markdown formatting cleanup.
package.json Bumps package version to 5.1.0 and updates @actions/cache to ^5.1.0.
package-lock.json Updates locked @actions/cache and transitive deps (but currently leaves the root package version at 5.0.4).
.licenses/npm/@actions/cache.dep.yml Updates tracked license metadata for @actions/cache@5.1.0.
.licenses/npm/@azure/core-client.dep.yml Updates tracked license metadata for @azure/core-client@1.10.2.
.licenses/npm/@azure/core-http-compat.dep.yml Updates tracked license metadata for @azure/core-http-compat@2.4.0.
.licenses/npm/@azure/core-rest-pipeline.dep.yml Updates tracked license metadata for @azure/core-rest-pipeline@1.24.0.
.licenses/npm/@azure/core-xml.dep.yml Updates tracked license metadata for @azure/core-xml@1.5.1.
.licenses/npm/@azure/storage-blob.dep.yml Updates tracked license metadata for @azure/storage-blob@12.32.0.
.licenses/npm/@azure/storage-common.dep.yml Updates tracked license metadata for @azure/storage-common@12.4.0.
.licenses/npm/@typespec/ts-http-runtime.dep.yml Updates tracked license metadata for @typespec/ts-http-runtime@0.3.6.
.licenses/npm/fast-xml-builder.dep.yml Updates tracked license metadata for fast-xml-builder@1.2.0.
.licenses/npm/fast-xml-parser.dep.yml Updates tracked license metadata for fast-xml-parser@5.9.2.
.licenses/npm/is-unsafe.dep.yml Adds tracked license metadata for new transitive dep is-unsafe@1.0.1.
.licenses/npm/path-expression-matcher.dep.yml Updates tracked license metadata for path-expression-matcher@1.5.0.
.licenses/npm/strnum.dep.yml Updates tracked license metadata for strnum@2.4.1.
.licenses/npm/anynum.dep.yml Adds tracked license metadata for new transitive dep anynum@1.0.1.
.licenses/npm/@nodable/entities.dep.yml Adds tracked license metadata for new transitive dep @nodable/entities@2.2.0.
.licenses/npm/xml-naming.dep.yml Adds tracked license metadata for new transitive dep xml-naming@0.1.0.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 21/26 changed files
  • Comments generated: 0

Comment thread README.md Resolved
Link-
Link- previously approved these changes Jun 19, 2026
@jasongin jasongin changed the title Bump @actions/cache to v5.1.0 - handle read-only cache access Bump @actions/cache to v6.1.0 - handle read-only cache access Jun 23, 2026
@jasongin

jasongin commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor Author

I rebased to resolve conflicts from #1760

Since that change bumped the version to v6.0, this change now goes to v6.1.

@danwkennedy danwkennedy left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@danwkennedy
danwkennedy merged commit 55cc834 into actions:main Jun 23, 2026
0 checks passed
@jasongin
jasongin deleted the readonly-cache branch June 23, 2026 20:30
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.

5 participants