Skip to content

feat: adopt @actions/cache 6.2.0 (cache-mode skip + read-denied warning) - #1781

Merged
philip-gai merged 3 commits into
mainfrom
philip-gai/bump-cache-toolkit-6.2.0
Jul 15, 2026
Merged

philip-gai merged 3 commits into
mainfrom
philip-gai/bump-cache-toolkit-6.2.0

Conversation

@philip-gai

Copy link
Copy Markdown
Member

Description

Adopts @actions/cache 6.2.0 and rebuilds the vendored dist/ bundles. The new toolkit version adds two cache-mode security behaviors:

  • ACTIONS_CACHE_MODE skip: when the runner sets ACTIONS_CACHE_MODE, the action skips operations the effective mode does not permit. Restore is skipped for none and write-only; save is skipped for none and read. Each skip emits a single non-fatal info line and returns a cache miss on restore or a no-op on save. It never throws.
  • Read/write denied warnings: when the cache service denies an operation because the token has no readable or writable scopes, the action surfaces a clear warning instead of a generic error, and continues without failing the run.

Motivation and Context

The cache service can restrict what a job's token is allowed to do (read, write, both, or neither). Previously a denied read or write surfaced as an opaque error. These changes make the client honor the mode up front and report policy denials clearly.

Regression safety: when ACTIONS_CACHE_MODE is unset or set to an unrecognized value, behavior is identical to today. The skip logic only triggers on the explicit restrictive values.

Note on activation: the client-side skip depends on the runner exporting ACTIONS_CACHE_MODE, and the denial warnings depend on the cache service returning the corresponding policy responses. Until those roll out, this bump is behavior-preserving.

Toolkit change: actions/toolkit#2447 (published as @actions/cache 6.2.0).

How Has This Been Tested?

  • Full @actions/cache unit suite passing in the toolkit repo (tsc, jest, prettier, eslint clean).
  • End-to-end validation on hosted runners using a test build of this action pinned to the unreleased toolkit code:
    • Env-driven matrix over none, read, write, write-only, unknown, and unset confirmed the expected skip or proceed outcome for both restore and save, with exactly one info line per skip and no failures.
    • With cache-mode enforcement enabled server-side, restore under a read-denied token returned the read-denied policy response and the action degraded to a warning plus cache miss; save under a write-denied token returned the write-denied policy response and degraded to a warning. Allowed and unset modes cached and restored normally.

Types of changes

  • New feature (non-breaking change which adds functionality)

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.

Bumps @actions/cache to ^6.2.0 and rebuilds the vendored dist bundles.
Note: package-lock.json must be regenerated with a registry install once
@actions/cache 6.2.0 is published to npm, before this is merged.

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

This PR updates the action to use @actions/cache 6.2.0 and refreshes the vendored dist/ bundles to pick up new cache-mode enforcement (skip behavior) and clearer policy-denial warnings.

Changes:

  • Bump @actions/cache from ^6.1.0 to ^6.2.0 (and update lockfile + license metadata).
  • Rebuild vendored dist/* bundles to include cache-mode “skip” behavior and read/write denied messaging improvements.
Show a summary per file
File Description
package.json Bumps @actions/cache dependency to ^6.2.0.
package-lock.json Locks @actions/cache to 6.2.0 with updated integrity/resolution metadata.
dist/save/index.js Rebuilt bundle for the save entrypoint including cache-mode / denial logic.
dist/save-only/index.js Rebuilt bundle for the save-only entrypoint including cache-mode / denial logic.
dist/restore/index.js Rebuilt bundle for the restore entrypoint including cache-mode / denial logic.
dist/restore-only/index.js Rebuilt bundle for the restore-only entrypoint including cache-mode / denial logic.
.licenses/npm/@actions/cache.dep.yml Updates recorded dependency version to 6.2.0.

Review details

Tip

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

  • Files reviewed: 2/7 changed files
  • Comments generated: 0
  • Review effort level: Low

@philip-gai
philip-gai marked this pull request as ready for review July 13, 2026 20:00
@philip-gai
philip-gai requested a review from a team as a code owner July 13, 2026 20:00

@boxofyellow boxofyellow left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM: :shipit:

@boxofyellow boxofyellow left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM: :shipit:

@philip-gai
philip-gai merged commit 3edfce9 into main Jul 15, 2026
17 checks passed
@philip-gai
philip-gai deleted the philip-gai/bump-cache-toolkit-6.2.0 branch July 15, 2026 18:13
toyamagu-2021 added a commit to toyamagu-2021/cache-s3 that referenced this pull request Sep 9, 2026
)

* Update packages, migrate to ESM

* Update documentation for v6 release

* Fix lint and jest issues

* Rebuild dist bundles as ESM to match type:module

* PR feedback

* Fix test mock return order

* Fixed licenses

* Rebuild dist

* Prettier fixes

* Bump @actions/cache to v6.1.0 - handle cache write error due to RO token

* Merge pull request actions#1781 from actions/philip-gai/bump-cache-toolkit-6.2.0

feat: adopt @actions/cache 6.2.0 (cache-mode skip + read-denied warning)

* chore: cut the fork's v6 line at 6.0.0

The changelog labels the two 6.0.0 entries, since the fork's release and the
upstream release it merges now share a number.

* chore: review the licenses of the packages the v6 tree pulled in

balanced-match v4 and brace-expansion v5 declare MIT but carry a dual
copyright header that licensed cannot classify; minimatch moved to
BlueOak-1.0.0 in v10.

---------

Co-authored-by: Joshua Brooks <samirat@github.com>
Co-authored-by: Jason Ginchereau <jasongin@microsoft.com>
Co-authored-by: Daniel Kennedy <danwkennedy@github.com>
Co-authored-by: Philip Gai <philip-gai@github.com>
abhijit-hota added a commit to WarpBuilds/cache that referenced this pull request Sep 28, 2026
* update to node24

* update licences

* license and compiled

* Approve license

* Update cache to use local cache package and Node 24 support

- Use local cache package with file:../packages/cache instead of published version
- Update all action.yml files to use node24 runtime
- Update dependencies to support Node 24 (@types/node@24.1.0)
- Rebuild dist files with local cache package
- Add engines field requiring node >=24

* Build dist files for Node 24

* chore: rebuild dist with local @actions/cache (core v2, exec v2)

* chore: use local @actions/core, exec, io packages

* Build with @actions/cache v5.0.0

* Use published @actions/core, exec, io v2.0.0

* chore: rebuild with @actions/cache v5.0.0

Uses updated cache package that removes @azure/ms-rest-js dependency to fix Node 24 punycode deprecation warning.

* Update with core 2.0.1 which has exec 2.0.0

* chore: update @actions/core to 2.0.1

* Latest dist with core changes

* Extra dist change

* chore: use published @actions/cache v5.0.0

* chore: update license cache for @actions/cache v5.0.0

* chore: rebuild dist with @actions/cache v5.0.0

* chore: update actions/checkout to v5 in workflow files

* chore: bump version to 5.0.0 for Node.js 24 support

* docs: update README with v5 release notes

* Revert "docs: update README with v5 release notes"

This reverts commit fe92eaf.

* chore: revert README to main branch state

* chore: set version to 4.3.0 for prepare release PR

* chore: rebuild dist with version 4.3.0

* chore: regenerate package-lock.json

* undo readme changes

* Prepare v5.0.0 release

- Bump package version to 5.0.0

- Add v5.0.0 release notes (Node.js 24 runtime + runner requirement)

* docs: update README for v5 release with Node 24 and runner version requirements

* readme note

* docs: highlight v5 runner requirement in releases

* fix: update @actions/cache with storage-blob fix for Node.js 24 punycode deprecation

* peer

* fix: update @actions/cache to ^5.0.1 for Node.js 24 punycode fix

Updates @actions/cache to version 5.0.1 which includes the @azure/storage-blob
update that fixes the punycode deprecation warning on Node.js 24.

* fix: update license files for @actions/cache, fast-xml-parser, and strnum

* fix: add peer property to package-lock.json for dependencies

* chore: release v5.0.1

- Bump version to 5.0.1
- Fix Node.js 24 punycode deprecation warning via @actions/cache@5.0.1
- Updates @azure/storage-blob to ^12.29.1

Related: actions#1685

* docs: Update examples to cache@v5

* docs: Update other actions in examples to the latest version

* Bump actions/cache to 5.0.3

* Add PR link to releases

* Build

* Update licensed record for cache

* license for httpclient

* Add 5.0.3 builds

* Upgrade dependencies and address security warnings

- Bump `@actions/cache` to v5.0.5
- Bump `@actions/core` to v2.0.3

* Add licensed output

* Add review for the @actions/http-client license

* Update contribution docs

* Add note

* Potential fix for code scanning alert no. 52: Workflow does not contain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Fix permissions for workflows/workflow.yml

* Fix workflow permissions and cleanup

* Cleanup workflow file names

* Update .github/workflows/pr-opened-workflow.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Rewrite and simplify

* Add wait for proxy

* Fix resolution

* Add traffic sanity check step

* Fix cache key in examples.md for bun.lock

Updated cache key to use 'bun.lock' instead of 'bun.lockb' for consistency.

* Update dependencies & patch security vulnerabilities

* Add licenses

* Update RELEASES

* Update ts-http-runtime to 0.3.5

* npm run build generated dist files

* licensed changes

* Update packages, migrate to ESM

* Update documentation for v6 release

* Fix lint and jest issues

* Rebuild dist bundles as ESM to match type:module

* PR feedback

* Fix test mock return order

* Fixed licenses

* Rebuild dist

* Prettier fixes

* Bump @actions/cache to v6.1.0 - handle cache write error due to RO token

* Merge pull request actions#1781 from actions/philip-gai/bump-cache-toolkit-6.2.0

feat: adopt @actions/cache 6.2.0 (cache-mode skip + read-denied warning)

* test: restore saveImpl error-path assertions from the fork

Add back the saveCache argument checks in the large cache, reserve cache
failure and server error tests, and the exactly-one-warning checks in
the five warning tests. The warning count uses the core.info calls that
start with "[warning]", which is how logWarning reports in the ESM
harness.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017uNkb5GuQRPMyJA2WDbH8B

---------

Co-authored-by: Salman Chishti <salmanmkc@GitHub.com>
Co-authored-by: XZTDean <xztdean@gmail.com>
Co-authored-by: Ryan Ghadimi <ghadimir@github.com>
Co-authored-by: Ryan Ghadimi <114221941+GhadimiR@users.noreply.github.com>
Co-authored-by: Bassem Dghaidi <568794+Link-@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ryan Peck <1244954+RyPeck@users.noreply.github.com>
Co-authored-by: Yang Cao <yacaovsnc@github.com>
Co-authored-by: Joshua Brooks <samirat@github.com>
Co-authored-by: Jason Ginchereau <jasongin@microsoft.com>
Co-authored-by: Daniel Kennedy <danwkennedy@github.com>
Co-authored-by: Philip Gai <philip-gai@github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.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.

3 participants