@@ -48,6 +48,7 @@ const cacheTwirpClient = __importStar(__nccwpck_require__(6819));
48
48
const config_1 = __nccwpck_require__(7606);
49
49
const tar_1 = __nccwpck_require__(5321);
50
50
const constants_1 = __nccwpck_require__(8287);
51
+ const http_client_1 = __nccwpck_require__(4844);
51
52
class ValidationError extends Error {
52
53
constructor(message) {
53
54
super(message);
@@ -84,7 +85,17 @@ function checkKey(key) {
84
85
* @returns boolean return true if Actions cache service feature is available, otherwise false
85
86
*/
86
87
function isFeatureAvailable() {
87
- return !!process.env['ACTIONS_CACHE_URL'];
88
+ const cacheServiceVersion = (0, config_1.getCacheServiceVersion)();
89
+ // Check availability based on cache service version
90
+ switch (cacheServiceVersion) {
91
+ case 'v2':
92
+ // For v2, we need ACTIONS_RESULTS_URL
93
+ return !!process.env['ACTIONS_RESULTS_URL'];
94
+ case 'v1':
95
+ default:
96
+ // For v1, we only need ACTIONS_CACHE_URL
97
+ return !!process.env['ACTIONS_CACHE_URL'];
98
+ }
88
99
}
89
100
exports.isFeatureAvailable = isFeatureAvailable;
90
101
/**
@@ -169,8 +180,16 @@ function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsAr
169
180
throw error;
170
181
}
171
182
else {
172
- // Supress all non-validation cache related errors because caching should be optional
173
- core.warning(`Failed to restore: ${error.message}`);
183
+ // warn on cache restore failure and continue build
184
+ // Log server errors (5xx) as errors, all other errors as warnings
185
+ if (typedError instanceof http_client_1.HttpClientError &&
186
+ typeof typedError.statusCode === 'number' &&
187
+ typedError.statusCode >= 500) {
188
+ core.error(`Failed to restore: ${error.message}`);
189
+ }
190
+ else {
191
+ core.warning(`Failed to restore: ${error.message}`);
192
+ }
174
193
}
175
194
}
176
195
finally {
@@ -223,7 +242,13 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
223
242
core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`);
224
243
return undefined;
225
244
}
226
- core.info(`Cache hit for: ${request.key}`);
245
+ const isRestoreKeyMatch = request.key !== response.matchedKey;
246
+ if (isRestoreKeyMatch) {
247
+ core.info(`Cache hit for restore-key: ${response.matchedKey}`);
248
+ }
249
+ else {
250
+ core.info(`Cache hit for: ${response.matchedKey}`);
251
+ }
227
252
if (options === null || options === void 0 ? void 0 : options.lookupOnly) {
228
253
core.info('Lookup only - skipping download');
229
254
return response.matchedKey;
@@ -248,7 +273,15 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
248
273
}
249
274
else {
250
275
// Supress all non-validation cache related errors because caching should be optional
251
- core.warning(`Failed to restore: ${error.message}`);
276
+ // Log server errors (5xx) as errors, all other errors as warnings
277
+ if (typedError instanceof http_client_1.HttpClientError &&
278
+ typeof typedError.statusCode === 'number' &&
279
+ typedError.statusCode >= 500) {
280
+ core.error(`Failed to restore: ${error.message}`);
281
+ }
282
+ else {
283
+ core.warning(`Failed to restore: ${error.message}`);
284
+ }
252
285
}
253
286
}
254
287
finally {
@@ -351,7 +384,15 @@ function saveCacheV1(paths, key, options, enableCrossOsArchive = false) {
351
384
core.info(`Failed to save: ${typedError.message}`);
352
385
}
353
386
else {
354
- core.warning(`Failed to save: ${typedError.message}`);
387
+ // Log server errors (5xx) as errors, all other errors as warnings
388
+ if (typedError instanceof http_client_1.HttpClientError &&
389
+ typeof typedError.statusCode === 'number' &&
390
+ typedError.statusCode >= 500) {
391
+ core.error(`Failed to save: ${typedError.message}`);
392
+ }
393
+ else {
394
+ core.warning(`Failed to save: ${typedError.message}`);
395
+ }
355
396
}
356
397
}
357
398
finally {
@@ -447,7 +488,15 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
447
488
core.info(`Failed to save: ${typedError.message}`);
448
489
}
449
490
else {
450
- core.warning(`Failed to save: ${typedError.message}`);
491
+ // Log server errors (5xx) as errors, all other errors as warnings
492
+ if (typedError instanceof http_client_1.HttpClientError &&
493
+ typeof typedError.statusCode === 'number' &&
494
+ typedError.statusCode >= 500) {
495
+ core.error(`Failed to save: ${typedError.message}`);
496
+ }
497
+ else {
498
+ core.warning(`Failed to save: ${typedError.message}`);
499
+ }
451
500
}
452
501
}
453
502
finally {
@@ -47626,6 +47675,10 @@ class RpcOutputStreamController {
47626
47675
cmp: [],
47627
47676
};
47628
47677
this._closed = false;
47678
+ // --- RpcOutputStream async iterator API
47679
+ // iterator state.
47680
+ // is undefined when no iterator has been acquired yet.
47681
+ this._itState = { q: [] };
47629
47682
}
47630
47683
// --- RpcOutputStream callback API
47631
47684
onNext(callback) {
@@ -47725,10 +47778,6 @@ class RpcOutputStreamController {
47725
47778
* messages are queued.
47726
47779
*/
47727
47780
[Symbol.asyncIterator]() {
47728
- // init the iterator state, enabling pushIt()
47729
- if (!this._itState) {
47730
- this._itState = { q: [] };
47731
- }
47732
47781
// if we are closed, we are definitely not receiving any more messages.
47733
47782
// but we can't let the iterator get stuck. we want to either:
47734
47783
// a) finish the new iterator immediately, because we are completed
@@ -47761,8 +47810,6 @@ class RpcOutputStreamController {
47761
47810
// this either resolves a pending promise, or enqueues the result.
47762
47811
pushIt(result) {
47763
47812
let state = this._itState;
47764
- if (!state)
47765
- return;
47766
47813
// is the consumer waiting for us?
47767
47814
if (state.p) {
47768
47815
// yes, consumer is waiting for this promise.
@@ -49674,6 +49721,7 @@ const reflection_equals_1 = __nccwpck_require__(4827);
49674
49721
const binary_writer_1 = __nccwpck_require__(3957);
49675
49722
const binary_reader_1 = __nccwpck_require__(2889);
49676
49723
const baseDescriptors = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({}));
49724
+ const messageTypeDescriptor = baseDescriptors[message_type_contract_1.MESSAGE_TYPE] = {};
49677
49725
/**
49678
49726
* This standard message type provides reflection-based
49679
49727
* operations to work with a message.
@@ -49684,7 +49732,8 @@ class MessageType {
49684
49732
this.typeName = name;
49685
49733
this.fields = fields.map(reflection_info_1.normalizeFieldInfo);
49686
49734
this.options = options !== null && options !== void 0 ? options : {};
49687
- this.messagePrototype = Object.create(null, Object.assign(Object.assign({}, baseDescriptors), { [message_type_contract_1.MESSAGE_TYPE]: { value: this } }));
49735
+ messageTypeDescriptor.value = this;
49736
+ this.messagePrototype = Object.create(null, baseDescriptors);
49688
49737
this.refTypeCheck = new reflection_type_check_1.ReflectionTypeCheck(this);
49689
49738
this.refJsonReader = new reflection_json_reader_1.ReflectionJsonReader(this);
49690
49739
this.refJsonWriter = new reflection_json_writer_1.ReflectionJsonWriter(this);
@@ -51201,12 +51250,16 @@ class ReflectionJsonReader {
51201
51250
target[localName] = field.T().internalJsonRead(jsonValue, options, target[localName]);
51202
51251
break;
51203
51252
case "enum":
51253
+ if (jsonValue === null)
51254
+ continue;
51204
51255
let val = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields);
51205
51256
if (val === false)
51206
51257
continue;
51207
51258
target[localName] = val;
51208
51259
break;
51209
51260
case "scalar":
51261
+ if (jsonValue === null)
51262
+ continue;
51210
51263
target[localName] = this.scalar(jsonValue, field.T, field.L, field.name);
51211
51264
break;
51212
51265
}
@@ -93352,7 +93405,7 @@ module.exports = parseParams
93352
93405
/***/ ((module) => {
93353
93406
93354
93407
"use strict";
93355
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"4.0.3","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","@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","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/node":"^22.13.9","@types/semver":"^6.0.0","typescript":"^5.2.2"}}');
93408
+ 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"}}');
93356
93409
93357
93410
/***/ }),
93358
93411
0 commit comments