From 0e0c6ab8f09579b75ac81aa6669f5927a6986569 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Aug 2026 00:23:49 +0000 Subject: [PATCH 1/2] fix(deps): bump @actions/cache in the actions-toolkit group Bumps the actions-toolkit group with 1 update: [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache). Updates `@actions/cache` from 6.1.0 to 6.2.0 - [Changelog](https://github.com/actions/toolkit/blob/main/packages/cache/RELEASES.md) - [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/cache) --- updated-dependencies: - dependency-name: "@actions/cache" dependency-version: 6.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions-toolkit ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index d0f3dfc..e60cfce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.2", "license": "MIT", "dependencies": { - "@actions/cache": "^6.1.0", + "@actions/cache": "^6.2.0", "@actions/core": "^3.0.1", "@actions/exec": "^3.0.0", "@actions/github": "^9.1.1", @@ -26,9 +26,9 @@ } }, "node_modules/@actions/cache": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-6.1.0.tgz", - "integrity": "sha512-LVqybSbzhBp2uAETOQ3HnVjXA4AcjavgMH+LCr+cjgO+PZfciv/1QAgoW+esXBaAhvDid+vXeV70GGJpAh4V5Q==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-6.2.0.tgz", + "integrity": "sha512-Nv0xWRmbxfDbAn/70flO/F6tj2Nv4XTYMAsQHiDFSojCDfso/Zni+fRKa14ToI9hnmOW/rQcY1WYb6wsM7Pgwg==", "license": "MIT", "dependencies": { "@actions/core": "^3.0.1", diff --git a/package.json b/package.json index 80917da..707738a 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "minisign" ], "dependencies": { - "@actions/cache": "^6.1.0", + "@actions/cache": "^6.2.0", "@actions/core": "^3.0.1", "@actions/exec": "^3.0.0", "@actions/github": "^9.1.1", From bff0e203430005826cae1ddeadce7be17e1dc304 Mon Sep 17 00:00:00 2001 From: chicoxyzzy Date: Fri, 21 Aug 2026 07:23:45 +0200 Subject: [PATCH 2/2] build: rebuild dist/ for @actions/cache 6.2.0 --- dist/main/index.js | 76 ++++++++++++++++++++++++++++++++++++++++------ dist/post/index.js | 21 ++++++++++--- 2 files changed, 82 insertions(+), 15 deletions(-) diff --git a/dist/main/index.js b/dist/main/index.js index 6ca2529..e84d6b1 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -23083,7 +23083,7 @@ var require_package = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module) { module.exports = { name: "@actions/cache", - version: "6.1.0", + version: "6.2.0", description: "Actions cache lib", keywords: [ "github", @@ -31443,6 +31443,7 @@ var SystemTarPathOnWindows = `${process.env["SYSTEMDRIVE"]}\\Windows\\System32\\ var TarFilename = "cache.tar"; var ManifestFilename = "manifest.txt"; var CacheFileSizeLimit = 10 * Math.pow(1024, 3); +var CacheReadDeniedMessagePrefix = "cache read denied:"; // node_modules/@actions/cache/lib/internal/cacheUtils.js var __awaiter12 = function(thisArg, _arguments, P, generator) { @@ -64154,6 +64155,20 @@ function getCacheServiceVersion() { return "v1"; return process.env["ACTIONS_CACHE_SERVICE_V2"] ? "v2" : "v1"; } +var KNOWN_CACHE_MODES = ["none", "read", "write", "write-only"]; +function getCacheMode() { + return (process.env["ACTIONS_CACHE_MODE"] || "").trim().toLowerCase(); +} +function isCacheReadable(mode) { + if (!KNOWN_CACHE_MODES.includes(mode)) + return true; + return mode === "read" || mode === "write"; +} +function isCacheWritable(mode) { + if (!KNOWN_CACHE_MODES.includes(mode)) + return true; + return mode === "write" || mode === "write-only"; +} function getCacheServiceURL() { const version3 = getCacheServiceVersion(); switch (version3) { @@ -64227,6 +64242,7 @@ function createHttpClient() { } function getCacheEntry(keys, paths, options) { return __awaiter16(this, void 0, void 0, function* () { + var _a; const httpClient2 = createHttpClient(); const version3 = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive); const resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version3}`; @@ -64240,6 +64256,10 @@ function getCacheEntry(keys, paths, options) { return null; } if (!isSuccessStatusCode(response.statusCode)) { + const errorMessage = (_a = response.error) === null || _a === void 0 ? void 0 : _a.message; + if (errorMessage === null || errorMessage === void 0 ? void 0 : errorMessage.includes(CacheReadDeniedMessagePrefix)) { + throw new Error(errorMessage); + } throw new Error(`Cache service responded with ${response.statusCode}`); } const cacheResult = response.result; @@ -65488,6 +65508,14 @@ var CacheWriteDeniedError = class _CacheWriteDeniedError extends ReserveCacheErr Object.setPrototypeOf(this, _CacheWriteDeniedError.prototype); } }; +var CACHE_READ_DENIED_PREFIX = CacheReadDeniedMessagePrefix; +var CacheReadDeniedError = class _CacheReadDeniedError extends Error { + constructor(message) { + super(message); + this.name = "CacheReadDeniedError"; + Object.setPrototypeOf(this, _CacheReadDeniedError.prototype); + } +}; var FinalizeCacheError = class _FinalizeCacheError extends Error { constructor(message) { super(message); @@ -65514,6 +65542,12 @@ function restoreCache(paths_1, primaryKey_1, restoreKeys_1, options_1) { const cacheServiceVersion = getCacheServiceVersion(); debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); + const cacheMode = getCacheMode(); + if (!isCacheReadable(cacheMode)) { + info(`Cache restore skipped: the effective cache-mode '${cacheMode}' does not permit reads.`); + debug(`Skipped restore for paths [${paths.join(", ")}] with primary key '${primaryKey}'.`); + return void 0; + } switch (cacheServiceVersion) { case "v2": return yield restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); @@ -65525,6 +65559,7 @@ function restoreCache(paths_1, primaryKey_1, restoreKeys_1, options_1) { } function restoreCacheV1(paths_1, primaryKey_1, restoreKeys_1, options_1) { return __awaiter19(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { + var _a; restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; debug("Resolved Keys:"); @@ -65538,10 +65573,19 @@ function restoreCacheV1(paths_1, primaryKey_1, restoreKeys_1, options_1) { const compressionMethod = yield getCompressionMethod(); let archivePath = ""; try { - const cacheEntry = yield getCacheEntry(keys, paths, { - compressionMethod, - enableCrossOsArchive - }); + let cacheEntry; + try { + cacheEntry = yield getCacheEntry(keys, paths, { + compressionMethod, + enableCrossOsArchive + }); + } catch (error2) { + const errorMessage = (_a = error2 === null || error2 === void 0 ? void 0 : error2.message) !== null && _a !== void 0 ? _a : ""; + if (errorMessage.includes(CACHE_READ_DENIED_PREFIX)) { + throw new CacheReadDeniedError(errorMessage); + } + throw error2; + } if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { return void 0; } @@ -65583,6 +65627,7 @@ function restoreCacheV1(paths_1, primaryKey_1, restoreKeys_1, options_1) { } function restoreCacheV2(paths_1, primaryKey_1, restoreKeys_1, options_1) { return __awaiter19(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { + var _a; options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; @@ -65603,7 +65648,16 @@ function restoreCacheV2(paths_1, primaryKey_1, restoreKeys_1, options_1) { restoreKeys, version: getCacheVersion(paths, compressionMethod, enableCrossOsArchive) }; - const response = yield twirpClient.GetCacheEntryDownloadURL(request2); + let response; + try { + response = yield twirpClient.GetCacheEntryDownloadURL(request2); + } catch (error2) { + const errorMessage = (_a = error2 === null || error2 === void 0 ? void 0 : error2.message) !== null && _a !== void 0 ? _a : ""; + if (errorMessage.includes(CACHE_READ_DENIED_PREFIX)) { + throw new CacheReadDeniedError(errorMessage); + } + throw error2; + } if (!response.ok) { debug(`Cache not found for version ${request2.version} of keys: ${keys.join(", ")}`); return void 0; @@ -65659,6 +65713,12 @@ function saveCache2(paths_1, key_1, options_1) { debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); checkKey(key); + const cacheMode = getCacheMode(); + if (!isCacheWritable(cacheMode)) { + info(`Cache save skipped: the effective cache-mode '${cacheMode}' does not permit writes.`); + debug(`Skipped save for paths [${paths.join(", ")}] with key '${key}'.`); + return -1; + } switch (cacheServiceVersion) { case "v2": return yield saveCacheV2(paths, key, options, enableCrossOsArchive); @@ -65716,8 +65776,6 @@ function saveCacheV1(paths_1, key_1, options_1) { const typedError = error2; if (typedError.name === ValidationError.name) { throw error2; - } else if (typedError.name === CacheWriteDeniedError.name) { - warning(`Failed to save: ${typedError.message}`); } else if (typedError.name === ReserveCacheError.name) { info(`Failed to save: ${typedError.message}`); } else { @@ -65805,8 +65863,6 @@ function saveCacheV2(paths_1, key_1, options_1) { const typedError = error2; if (typedError.name === ValidationError.name) { throw error2; - } else if (typedError.name === CacheWriteDeniedError.name) { - warning(`Failed to save: ${typedError.message}`); } else if (typedError.name === ReserveCacheError.name) { info(`Failed to save: ${typedError.message}`); } else if (typedError.name === FinalizeCacheError.name) { diff --git a/dist/post/index.js b/dist/post/index.js index e9a1ae2..5deeff1 100644 --- a/dist/post/index.js +++ b/dist/post/index.js @@ -23986,7 +23986,7 @@ var require_package = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module) { module.exports = { name: "@actions/cache", - version: "6.1.0", + version: "6.2.0", description: "Actions cache lib", keywords: [ "github", @@ -66978,6 +66978,15 @@ function getCacheServiceVersion() { return "v1"; return process.env["ACTIONS_CACHE_SERVICE_V2"] ? "v2" : "v1"; } +var KNOWN_CACHE_MODES = ["none", "read", "write", "write-only"]; +function getCacheMode() { + return (process.env["ACTIONS_CACHE_MODE"] || "").trim().toLowerCase(); +} +function isCacheWritable(mode) { + if (!KNOWN_CACHE_MODES.includes(mode)) + return true; + return mode === "write" || mode === "write-only"; +} function getCacheServiceURL() { const version3 = getCacheServiceVersion(); switch (version3) { @@ -68267,6 +68276,12 @@ function saveCache2(paths_1, key_1, options_1) { debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); checkKey(key); + const cacheMode = getCacheMode(); + if (!isCacheWritable(cacheMode)) { + info(`Cache save skipped: the effective cache-mode '${cacheMode}' does not permit writes.`); + debug(`Skipped save for paths [${paths.join(", ")}] with key '${key}'.`); + return -1; + } switch (cacheServiceVersion) { case "v2": return yield saveCacheV2(paths, key, options, enableCrossOsArchive); @@ -68324,8 +68339,6 @@ function saveCacheV1(paths_1, key_1, options_1) { const typedError = error2; if (typedError.name === ValidationError.name) { throw error2; - } else if (typedError.name === CacheWriteDeniedError.name) { - warning(`Failed to save: ${typedError.message}`); } else if (typedError.name === ReserveCacheError.name) { info(`Failed to save: ${typedError.message}`); } else { @@ -68413,8 +68426,6 @@ function saveCacheV2(paths_1, key_1, options_1) { const typedError = error2; if (typedError.name === ValidationError.name) { throw error2; - } else if (typedError.name === CacheWriteDeniedError.name) { - warning(`Failed to save: ${typedError.message}`); } else if (typedError.name === ReserveCacheError.name) { info(`Failed to save: ${typedError.message}`); } else if (typedError.name === FinalizeCacheError.name) {