@@ -39,15 +39,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
3939 });
4040};
4141Object.defineProperty(exports, "__esModule", ({ value: true }));
42- exports.saveCache = exports.restoreCache = exports.isFeatureAvailable = exports.ReserveCacheError = exports.ValidationError = void 0;
42+ exports.saveCache = exports.restoreCache = exports.isFeatureAvailable = exports.FinalizeCacheError = exports. ReserveCacheError = exports.ValidationError = void 0;
4343const core = __importStar(__nccwpck_require__(7484));
4444const path = __importStar(__nccwpck_require__(6928));
4545const utils = __importStar(__nccwpck_require__(8299));
4646const cacheHttpClient = __importStar(__nccwpck_require__(3171));
4747const cacheTwirpClient = __importStar(__nccwpck_require__(6819));
4848const config_1 = __nccwpck_require__(7606);
4949const tar_1 = __nccwpck_require__(5321);
50- const constants_1 = __nccwpck_require__(8287);
5150const http_client_1 = __nccwpck_require__(4844);
5251class ValidationError extends Error {
5352 constructor(message) {
@@ -65,6 +64,14 @@ class ReserveCacheError extends Error {
6564 }
6665}
6766exports.ReserveCacheError = ReserveCacheError;
67+ class FinalizeCacheError extends Error {
68+ constructor(message) {
69+ super(message);
70+ this.name = 'FinalizeCacheError';
71+ Object.setPrototypeOf(this, FinalizeCacheError.prototype);
72+ }
73+ }
74+ exports.FinalizeCacheError = FinalizeCacheError;
6875function checkPaths(paths) {
6976 if (!paths || paths.length === 0) {
7077 throw new ValidationError(`Path Validation Error: At least one directory or file path is required`);
@@ -441,10 +448,6 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
441448 }
442449 const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
443450 core.debug(`File Size: ${archiveFileSize}`);
444- // For GHES, this check will take place in ReserveCache API with enterprise file size limit
445- if (archiveFileSize > constants_1.CacheFileSizeLimit && !(0, config_1.isGhes)()) {
446- throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`);
447- }
448451 // Set the archive size in the options, will be used to display the upload progress
449452 options.archiveSizeBytes = archiveFileSize;
450453 core.debug('Reserving Cache');
@@ -457,7 +460,10 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
457460 try {
458461 const response = yield twirpClient.CreateCacheEntry(request);
459462 if (!response.ok) {
460- throw new Error('Response was not ok');
463+ if (response.message) {
464+ core.warning(`Cache reservation failed: ${response.message}`);
465+ }
466+ throw new Error(response.message || 'Response was not ok');
461467 }
462468 signedUploadUrl = response.signedUploadUrl;
463469 }
@@ -475,6 +481,9 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
475481 const finalizeResponse = yield twirpClient.FinalizeCacheEntryUpload(finalizeRequest);
476482 core.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`);
477483 if (!finalizeResponse.ok) {
484+ if (finalizeResponse.message) {
485+ throw new FinalizeCacheError(finalizeResponse.message);
486+ }
478487 throw new Error(`Unable to finalize cache with key ${key}, another job may be finalizing this cache.`);
479488 }
480489 cacheId = parseInt(finalizeResponse.entryId);
@@ -487,6 +496,9 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
487496 else if (typedError.name === ReserveCacheError.name) {
488497 core.info(`Failed to save: ${typedError.message}`);
489498 }
499+ else if (typedError.name === FinalizeCacheError.name) {
500+ core.warning(typedError.message);
501+ }
490502 else {
491503 // Log server errors (5xx) as errors, all other errors as warnings
492504 if (typedError instanceof http_client_1.HttpClientError &&
@@ -598,11 +610,12 @@ class CreateCacheEntryResponse$Type extends runtime_5.MessageType {
598610 constructor() {
599611 super("github.actions.results.api.v1.CreateCacheEntryResponse", [
600612 { no: 1, name: "ok", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
601- { no: 2, name: "signed_upload_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
613+ { no: 2, name: "signed_upload_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
614+ { no: 3, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
602615 ]);
603616 }
604617 create(value) {
605- const message = { ok: false, signedUploadUrl: "" };
618+ const message = { ok: false, signedUploadUrl: "", message: "" };
606619 globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this });
607620 if (value !== undefined)
608621 (0, runtime_3.reflectionMergePartial)(this, message, value);
@@ -619,6 +632,9 @@ class CreateCacheEntryResponse$Type extends runtime_5.MessageType {
619632 case /* string signed_upload_url */ 2:
620633 message.signedUploadUrl = reader.string();
621634 break;
635+ case /* string message */ 3:
636+ message.message = reader.string();
637+ break;
622638 default:
623639 let u = options.readUnknownField;
624640 if (u === "throw")
@@ -637,6 +653,9 @@ class CreateCacheEntryResponse$Type extends runtime_5.MessageType {
637653 /* string signed_upload_url = 2; */
638654 if (message.signedUploadUrl !== "")
639655 writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.signedUploadUrl);
656+ /* string message = 3; */
657+ if (message.message !== "")
658+ writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.message);
640659 let u = options.writeUnknownFields;
641660 if (u !== false)
642661 (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -720,11 +739,12 @@ class FinalizeCacheEntryUploadResponse$Type extends runtime_5.MessageType {
720739 constructor() {
721740 super("github.actions.results.api.v1.FinalizeCacheEntryUploadResponse", [
722741 { no: 1, name: "ok", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
723- { no: 2, name: "entry_id", kind: "scalar", T: 3 /*ScalarType.INT64*/ }
742+ { no: 2, name: "entry_id", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
743+ { no: 3, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
724744 ]);
725745 }
726746 create(value) {
727- const message = { ok: false, entryId: "0" };
747+ const message = { ok: false, entryId: "0", message: "" };
728748 globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this });
729749 if (value !== undefined)
730750 (0, runtime_3.reflectionMergePartial)(this, message, value);
@@ -741,6 +761,9 @@ class FinalizeCacheEntryUploadResponse$Type extends runtime_5.MessageType {
741761 case /* int64 entry_id */ 2:
742762 message.entryId = reader.int64().toString();
743763 break;
764+ case /* string message */ 3:
765+ message.message = reader.string();
766+ break;
744767 default:
745768 let u = options.readUnknownField;
746769 if (u === "throw")
@@ -759,6 +782,9 @@ class FinalizeCacheEntryUploadResponse$Type extends runtime_5.MessageType {
759782 /* int64 entry_id = 2; */
760783 if (message.entryId !== "0")
761784 writer.tag(2, runtime_1.WireType.Varint).int64(message.entryId);
785+ /* string message = 3; */
786+ if (message.message !== "")
787+ writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.message);
762788 let u = options.writeUnknownFields;
763789 if (u !== false)
764790 (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -66524,7 +66550,7 @@ module.exports = require("zlib");
6652466550/***/ ((module) => {
6652566551
6652666552"use strict";
66527- module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"4.0.5","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@protobuf-ts/runtime-rpc":"^2.11.1","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","semver":"^6.3.1"},"devDependencies":{"@types/node":"^22.13.9","@types/semver":"^6.0.0","@protobuf-ts/plugin":"^2.9.4","typescript":"^5.2.2"}}');
66553+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"4.1.0","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@protobuf-ts/runtime-rpc":"^2.11.1","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","semver":"^6.3.1"},"devDependencies":{"@types/node":"^22.13.9","@types/semver":"^6.0.0","@protobuf-ts/plugin":"^2.9.4","typescript":"^5.2.2"}}');
6652866554
6652966555/***/ }),
6653066556