mirror of
https://github.com/gradle/actions.git
synced 2025-04-19 01:09:20 +08:00
update actions/cache4.0.0 and migrate patch
This commit is contained in:
parent
35af9b8791
commit
7e2474009a
112
sources/package-lock.json
generated
112
sources/package-lock.json
generated
@ -11,7 +11,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/artifact": "2.1.11",
|
||||
"@actions/cache": "3.3.0",
|
||||
"@actions/cache": "4.0.0",
|
||||
"@actions/core": "1.11.1",
|
||||
"@actions/exec": "1.1.1",
|
||||
"@actions/github": "6.0.0",
|
||||
@ -199,9 +199,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/cache": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.3.0.tgz",
|
||||
"integrity": "sha512-+eCsMTIZUEm+QA9GqjollOhCdvRrZ1JV8d9Rp34zVNizBkYITO8dhKczP5Xps1dFzc5n59p7vYVtZrGt18bb5Q==",
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-4.0.0.tgz",
|
||||
"integrity": "sha512-WIuxjnZ44lNYtIS4fqSaYvF00hORdy3cSin+jx8xNgBVGWnNIAiCBHjlwusVQlcgExoQC9pHXGrDsZyZr7rCDQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/exec": "^1.0.1",
|
||||
@ -211,7 +212,9 @@
|
||||
"@azure/abort-controller": "^1.1.0",
|
||||
"@azure/ms-rest-js": "^2.6.0",
|
||||
"@azure/storage-blob": "^12.13.0",
|
||||
"semver": "^6.3.1"
|
||||
"@protobuf-ts/plugin": "^2.9.4",
|
||||
"semver": "^6.3.1",
|
||||
"twirp-ts": "^2.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/cache/node_modules/@actions/glob": {
|
||||
@ -2180,14 +2183,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@protobuf-ts/plugin": {
|
||||
"version": "2.9.3",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.9.3.tgz",
|
||||
"integrity": "sha512-tHYACv+nnIV2eoiMxeZhrgMqGiUktzUzrhfgnROg/rr8TecPLp9v5/yqNibN+bad5k7d57aqlTuQKhFl+J4W/g==",
|
||||
"version": "2.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.9.4.tgz",
|
||||
"integrity": "sha512-Db5Laq5T3mc6ERZvhIhkj1rn57/p8gbWiCKxQWbZBBl20wMuqKoHbRw4tuD7FyXi+IkwTToaNVXymv5CY3E8Rw==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@protobuf-ts/plugin-framework": "^2.9.3",
|
||||
"@protobuf-ts/protoc": "^2.9.3",
|
||||
"@protobuf-ts/runtime": "^2.9.3",
|
||||
"@protobuf-ts/runtime-rpc": "^2.9.3",
|
||||
"@protobuf-ts/plugin-framework": "^2.9.4",
|
||||
"@protobuf-ts/protoc": "^2.9.4",
|
||||
"@protobuf-ts/runtime": "^2.9.4",
|
||||
"@protobuf-ts/runtime-rpc": "^2.9.4",
|
||||
"typescript": "^3.9"
|
||||
},
|
||||
"bin": {
|
||||
@ -2196,11 +2200,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@protobuf-ts/plugin-framework": {
|
||||
"version": "2.9.3",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.9.3.tgz",
|
||||
"integrity": "sha512-iqdkhAu7fGPvBCVOoAEEFJ1/oaGIBoNIMgSv2WonTNJVHxv5FvvAfWFn6nG/eta34fHRZT38ZXTaYcMUkv8AiQ==",
|
||||
"version": "2.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.9.4.tgz",
|
||||
"integrity": "sha512-9nuX1kjdMliv+Pes8dQCKyVhjKgNNfwxVHg+tx3fLXSfZZRcUHMc1PMwB9/vTvc6gBKt9QGz5ERqSqZc0++E9A==",
|
||||
"license": "(Apache-2.0 AND BSD-3-Clause)",
|
||||
"dependencies": {
|
||||
"@protobuf-ts/runtime": "^2.9.3",
|
||||
"@protobuf-ts/runtime": "^2.9.4",
|
||||
"typescript": "^3.9"
|
||||
}
|
||||
},
|
||||
@ -2229,24 +2234,27 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@protobuf-ts/protoc": {
|
||||
"version": "2.9.3",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.9.3.tgz",
|
||||
"integrity": "sha512-TJ0Ycx/CIBqpB4wpKt6K05kjXj6zv36s/qpdCT/wdJBhpayOVBqLF5NpLp3WIiw1PmIxvqalB6QHKjvnLzGKLA==",
|
||||
"version": "2.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.9.4.tgz",
|
||||
"integrity": "sha512-hQX+nOhFtrA+YdAXsXEDrLoGJqXHpgv4+BueYF0S9hy/Jq0VRTVlJS1Etmf4qlMt/WdigEes5LOd/LDzui4GIQ==",
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"protoc": "protoc.js"
|
||||
}
|
||||
},
|
||||
"node_modules/@protobuf-ts/runtime": {
|
||||
"version": "2.9.3",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.9.3.tgz",
|
||||
"integrity": "sha512-nivzCpg/qYD0RX2OmHOahJALb8ndjGmUhNBcTJ0BbXoqKwCSM6vYA+vegzS3rhuaPgbyC7Ec8idlnizzUfIRuw=="
|
||||
"version": "2.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.9.4.tgz",
|
||||
"integrity": "sha512-vHRFWtJJB/SiogWDF0ypoKfRIZ41Kq+G9cEFj6Qm1eQaAhJ1LDFvgZ7Ja4tb3iLOQhz0PaoPnnOijF1qmEqTxg==",
|
||||
"license": "(Apache-2.0 AND BSD-3-Clause)"
|
||||
},
|
||||
"node_modules/@protobuf-ts/runtime-rpc": {
|
||||
"version": "2.9.3",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.9.3.tgz",
|
||||
"integrity": "sha512-WelHpctvZeG8yhbb7tnsrLzotq9xjMCXuGuhJ8qMyEdNoBBEodbXseofAYFTebo2/PN2LzyEq3X6vwr5f8jqTA==",
|
||||
"version": "2.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.9.4.tgz",
|
||||
"integrity": "sha512-y9L9JgnZxXFqH5vD4d7j9duWvIJ7AShyBRoNKJGhu9Q27qIbchfzli66H9RvrQNIFk5ER7z1Twe059WZGqERcA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@protobuf-ts/runtime": "^2.9.3"
|
||||
"@protobuf-ts/runtime": "^2.9.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@sinclair/typebox": {
|
||||
@ -9970,9 +9978,9 @@
|
||||
}
|
||||
},
|
||||
"@actions/cache": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.3.0.tgz",
|
||||
"integrity": "sha512-+eCsMTIZUEm+QA9GqjollOhCdvRrZ1JV8d9Rp34zVNizBkYITO8dhKczP5Xps1dFzc5n59p7vYVtZrGt18bb5Q==",
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-4.0.0.tgz",
|
||||
"integrity": "sha512-WIuxjnZ44lNYtIS4fqSaYvF00hORdy3cSin+jx8xNgBVGWnNIAiCBHjlwusVQlcgExoQC9pHXGrDsZyZr7rCDQ==",
|
||||
"requires": {
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/exec": "^1.0.1",
|
||||
@ -9982,7 +9990,9 @@
|
||||
"@azure/abort-controller": "^1.1.0",
|
||||
"@azure/ms-rest-js": "^2.6.0",
|
||||
"@azure/storage-blob": "^12.13.0",
|
||||
"semver": "^6.3.1"
|
||||
"@protobuf-ts/plugin": "^2.9.4",
|
||||
"semver": "^6.3.1",
|
||||
"twirp-ts": "^2.5.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/glob": {
|
||||
@ -11510,14 +11520,14 @@
|
||||
"dev": true
|
||||
},
|
||||
"@protobuf-ts/plugin": {
|
||||
"version": "2.9.3",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.9.3.tgz",
|
||||
"integrity": "sha512-tHYACv+nnIV2eoiMxeZhrgMqGiUktzUzrhfgnROg/rr8TecPLp9v5/yqNibN+bad5k7d57aqlTuQKhFl+J4W/g==",
|
||||
"version": "2.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.9.4.tgz",
|
||||
"integrity": "sha512-Db5Laq5T3mc6ERZvhIhkj1rn57/p8gbWiCKxQWbZBBl20wMuqKoHbRw4tuD7FyXi+IkwTToaNVXymv5CY3E8Rw==",
|
||||
"requires": {
|
||||
"@protobuf-ts/plugin-framework": "^2.9.3",
|
||||
"@protobuf-ts/protoc": "^2.9.3",
|
||||
"@protobuf-ts/runtime": "^2.9.3",
|
||||
"@protobuf-ts/runtime-rpc": "^2.9.3",
|
||||
"@protobuf-ts/plugin-framework": "^2.9.4",
|
||||
"@protobuf-ts/protoc": "^2.9.4",
|
||||
"@protobuf-ts/runtime": "^2.9.4",
|
||||
"@protobuf-ts/runtime-rpc": "^2.9.4",
|
||||
"typescript": "^3.9"
|
||||
},
|
||||
"dependencies": {
|
||||
@ -11529,11 +11539,11 @@
|
||||
}
|
||||
},
|
||||
"@protobuf-ts/plugin-framework": {
|
||||
"version": "2.9.3",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.9.3.tgz",
|
||||
"integrity": "sha512-iqdkhAu7fGPvBCVOoAEEFJ1/oaGIBoNIMgSv2WonTNJVHxv5FvvAfWFn6nG/eta34fHRZT38ZXTaYcMUkv8AiQ==",
|
||||
"version": "2.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.9.4.tgz",
|
||||
"integrity": "sha512-9nuX1kjdMliv+Pes8dQCKyVhjKgNNfwxVHg+tx3fLXSfZZRcUHMc1PMwB9/vTvc6gBKt9QGz5ERqSqZc0++E9A==",
|
||||
"requires": {
|
||||
"@protobuf-ts/runtime": "^2.9.3",
|
||||
"@protobuf-ts/runtime": "^2.9.4",
|
||||
"typescript": "^3.9"
|
||||
},
|
||||
"dependencies": {
|
||||
@ -11545,21 +11555,21 @@
|
||||
}
|
||||
},
|
||||
"@protobuf-ts/protoc": {
|
||||
"version": "2.9.3",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.9.3.tgz",
|
||||
"integrity": "sha512-TJ0Ycx/CIBqpB4wpKt6K05kjXj6zv36s/qpdCT/wdJBhpayOVBqLF5NpLp3WIiw1PmIxvqalB6QHKjvnLzGKLA=="
|
||||
"version": "2.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.9.4.tgz",
|
||||
"integrity": "sha512-hQX+nOhFtrA+YdAXsXEDrLoGJqXHpgv4+BueYF0S9hy/Jq0VRTVlJS1Etmf4qlMt/WdigEes5LOd/LDzui4GIQ=="
|
||||
},
|
||||
"@protobuf-ts/runtime": {
|
||||
"version": "2.9.3",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.9.3.tgz",
|
||||
"integrity": "sha512-nivzCpg/qYD0RX2OmHOahJALb8ndjGmUhNBcTJ0BbXoqKwCSM6vYA+vegzS3rhuaPgbyC7Ec8idlnizzUfIRuw=="
|
||||
"version": "2.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.9.4.tgz",
|
||||
"integrity": "sha512-vHRFWtJJB/SiogWDF0ypoKfRIZ41Kq+G9cEFj6Qm1eQaAhJ1LDFvgZ7Ja4tb3iLOQhz0PaoPnnOijF1qmEqTxg=="
|
||||
},
|
||||
"@protobuf-ts/runtime-rpc": {
|
||||
"version": "2.9.3",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.9.3.tgz",
|
||||
"integrity": "sha512-WelHpctvZeG8yhbb7tnsrLzotq9xjMCXuGuhJ8qMyEdNoBBEodbXseofAYFTebo2/PN2LzyEq3X6vwr5f8jqTA==",
|
||||
"version": "2.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.9.4.tgz",
|
||||
"integrity": "sha512-y9L9JgnZxXFqH5vD4d7j9duWvIJ7AShyBRoNKJGhu9Q27qIbchfzli66H9RvrQNIFk5ER7z1Twe059WZGqERcA==",
|
||||
"requires": {
|
||||
"@protobuf-ts/runtime": "^2.9.3"
|
||||
"@protobuf-ts/runtime": "^2.9.4"
|
||||
}
|
||||
},
|
||||
"@sinclair/typebox": {
|
||||
|
@ -33,7 +33,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/artifact": "2.1.11",
|
||||
"@actions/cache": "3.3.0",
|
||||
"@actions/cache": "4.0.0",
|
||||
"@actions/core": "1.11.1",
|
||||
"@actions/exec": "1.1.1",
|
||||
"@actions/github": "6.0.0",
|
||||
|
@ -1,113 +0,0 @@
|
||||
diff --git a/node_modules/@actions/cache/lib/cache.d.ts b/node_modules/@actions/cache/lib/cache.d.ts
|
||||
index 4658366..b796e58 100644
|
||||
--- a/node_modules/@actions/cache/lib/cache.d.ts
|
||||
+++ b/node_modules/@actions/cache/lib/cache.d.ts
|
||||
@@ -21,7 +21,7 @@ export declare function isFeatureAvailable(): boolean;
|
||||
* @param enableCrossOsArchive an optional boolean enabled to restore on windows any cache created on any platform
|
||||
* @returns string returns the key for the cache hit, otherwise returns undefined
|
||||
*/
|
||||
-export declare function restoreCache(paths: string[], primaryKey: string, restoreKeys?: string[], options?: DownloadOptions, enableCrossOsArchive?: boolean): Promise<string | undefined>;
|
||||
+export declare function restoreCache(paths: string[], primaryKey: string, restoreKeys?: string[], options?: DownloadOptions, enableCrossOsArchive?: boolean): Promise<CacheEntry | undefined>;
|
||||
/**
|
||||
* Saves a list of files with the specified key
|
||||
*
|
||||
@@ -31,4 +31,12 @@ export declare function restoreCache(paths: string[], primaryKey: string, restor
|
||||
* @param options cache upload options
|
||||
* @returns number returns cacheId if the cache was saved successfully and throws an error if save fails
|
||||
*/
|
||||
-export declare function saveCache(paths: string[], key: string, options?: UploadOptions, enableCrossOsArchive?: boolean): Promise<number>;
|
||||
+export declare function saveCache(paths: string[], key: string, options?: UploadOptions, enableCrossOsArchive?: boolean): Promise<CacheEntry>;
|
||||
+
|
||||
+// PATCHED: Add `CacheEntry` as return type for save/restore functions
|
||||
+// This allows us to track and report on cache entry sizes.
|
||||
+export declare class CacheEntry {
|
||||
+ key: string;
|
||||
+ size?: number;
|
||||
+ constructor(key: string, size?: number);
|
||||
+}
|
||||
diff --git a/node_modules/@actions/cache/lib/cache.js b/node_modules/@actions/cache/lib/cache.js
|
||||
index 9d636aa..a176bd7 100644
|
||||
--- a/node_modules/@actions/cache/lib/cache.js
|
||||
+++ b/node_modules/@actions/cache/lib/cache.js
|
||||
@@ -127,18 +127,21 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch
|
||||
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
||||
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
||||
core.info('Cache restored successfully');
|
||||
- return cacheEntry.cacheKey;
|
||||
- }
|
||||
- catch (error) {
|
||||
- const typedError = error;
|
||||
- if (typedError.name === ValidationError.name) {
|
||||
- throw error;
|
||||
- }
|
||||
- else {
|
||||
- // Supress all non-validation cache related errors because caching should be optional
|
||||
- core.warning(`Failed to restore: ${error.message}`);
|
||||
- }
|
||||
+
|
||||
+ // PATCHED - Return more inforamtion about restored entry
|
||||
+ return new CacheEntry(cacheEntry.cacheKey, archiveFileSize);;
|
||||
}
|
||||
+ // PATCHED - propagate errors
|
||||
+ // catch (error) {
|
||||
+ // const typedError = error;
|
||||
+ // if (typedError.name === ValidationError.name) {
|
||||
+ // throw error;
|
||||
+ // }
|
||||
+ // else {
|
||||
+ // // Supress all non-validation cache related errors because caching should be optional
|
||||
+ // core.warning(`Failed to restore: ${error.message}`);
|
||||
+ // }
|
||||
+ // }
|
||||
finally {
|
||||
// Try to delete the archive to save space
|
||||
try {
|
||||
@@ -206,19 +209,23 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) {
|
||||
}
|
||||
core.debug(`Saving Cache (ID: ${cacheId})`);
|
||||
yield cacheHttpClient.saveCache(cacheId, archivePath, options);
|
||||
+
|
||||
+ // PATCHED - Return more inforamtion about saved entry
|
||||
+ return new CacheEntry(key, archiveFileSize);
|
||||
}
|
||||
- catch (error) {
|
||||
- const typedError = error;
|
||||
- if (typedError.name === ValidationError.name) {
|
||||
- throw error;
|
||||
- }
|
||||
- else if (typedError.name === ReserveCacheError.name) {
|
||||
- core.info(`Failed to save: ${typedError.message}`);
|
||||
- }
|
||||
- else {
|
||||
- core.warning(`Failed to save: ${typedError.message}`);
|
||||
- }
|
||||
- }
|
||||
+ // PATCHED - propagate errors
|
||||
+ // catch (error) {
|
||||
+ // const typedError = error;
|
||||
+ // if (typedError.name === ValidationError.name) {
|
||||
+ // throw error;
|
||||
+ // }
|
||||
+ // else if (typedError.name === ReserveCacheError.name) {
|
||||
+ // core.info(`Failed to save: ${typedError.message}`);
|
||||
+ // }
|
||||
+ // else {
|
||||
+ // core.warning(`Failed to save: ${typedError.message}`);
|
||||
+ // }
|
||||
+ // }
|
||||
finally {
|
||||
// Try to delete the archive to save space
|
||||
try {
|
||||
@@ -232,4 +239,11 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) {
|
||||
});
|
||||
}
|
||||
exports.saveCache = saveCache;
|
||||
+class CacheEntry {
|
||||
+ constructor(key, size) {
|
||||
+ this.key = key;
|
||||
+ this.size = size;
|
||||
+ }
|
||||
+}
|
||||
+exports.CacheEntry = CacheEntry;
|
||||
//# sourceMappingURL=cache.js.map
|
||||
\ No newline at end of file
|
182
sources/patches/@actions+cache+4.0.0.patch
Normal file
182
sources/patches/@actions+cache+4.0.0.patch
Normal file
@ -0,0 +1,182 @@
|
||||
diff --git a/node_modules/@actions/cache/lib/cache.d.ts b/node_modules/@actions/cache/lib/cache.d.ts
|
||||
index ef0928b..e011501 100644
|
||||
--- a/node_modules/@actions/cache/lib/cache.d.ts
|
||||
+++ b/node_modules/@actions/cache/lib/cache.d.ts
|
||||
@@ -21,8 +21,7 @@ export declare function isFeatureAvailable(): boolean;
|
||||
* @param enableCrossOsArchive an optional boolean enabled to restore on windows any cache created on any platform
|
||||
* @returns string returns the key for the cache hit, otherwise returns undefined
|
||||
*/
|
||||
-export declare function restoreCache(paths: string[], primaryKey: string, restoreKeys?: string[], options?: DownloadOptions, enableCrossOsArchive?: boolean): Promise<string | undefined>;
|
||||
-/**
|
||||
+export declare function restoreCache(paths: string[], primaryKey: string, restoreKeys?: string[], options?: DownloadOptions, enableCrossOsArchive?: boolean): Promise<CacheEntry | undefined>;/**
|
||||
* Saves a list of files with the specified key
|
||||
*
|
||||
* @param paths a list of file paths to be cached
|
||||
@@ -31,4 +30,12 @@ export declare function restoreCache(paths: string[], primaryKey: string, restor
|
||||
* @param options cache upload options
|
||||
* @returns number returns cacheId if the cache was saved successfully and throws an error if save fails
|
||||
*/
|
||||
-export declare function saveCache(paths: string[], key: string, options?: UploadOptions, enableCrossOsArchive?: boolean): Promise<number>;
|
||||
+export declare function saveCache(paths: string[], key: string, options?: UploadOptions, enableCrossOsArchive?: boolean): Promise<CacheEntry>;
|
||||
+
|
||||
+// PATCHED: Add `CacheEntry` as return type for save/restore functions
|
||||
+// This allows us to track and report on cache entry sizes.
|
||||
+export declare class CacheEntry {
|
||||
+ key: string;
|
||||
+ size?: number;
|
||||
+ constructor(key: string, size?: number);
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/node_modules/@actions/cache/lib/cache.js b/node_modules/@actions/cache/lib/cache.js
|
||||
index 45201b6..f3a26d2 100644
|
||||
--- a/node_modules/@actions/cache/lib/cache.js
|
||||
+++ b/node_modules/@actions/cache/lib/cache.js
|
||||
@@ -154,18 +154,20 @@ function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
||||
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
||||
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
||||
core.info('Cache restored successfully');
|
||||
- return cacheEntry.cacheKey;
|
||||
- }
|
||||
- catch (error) {
|
||||
- const typedError = error;
|
||||
- if (typedError.name === ValidationError.name) {
|
||||
- throw error;
|
||||
- }
|
||||
- else {
|
||||
- // Supress all non-validation cache related errors because caching should be optional
|
||||
- core.warning(`Failed to restore: ${error.message}`);
|
||||
- }
|
||||
+ // PATCHED - Return more inforamtion about restored entry
|
||||
+ return new CacheEntry(cacheEntry.cacheKey, archiveFileSize);;
|
||||
}
|
||||
+ // PATCHED - propagate errors
|
||||
+ // catch (error) {
|
||||
+ // const typedError = error;
|
||||
+ // if (typedError.name === ValidationError.name) {
|
||||
+ // throw error;
|
||||
+ // }
|
||||
+ // else {
|
||||
+ // // Supress all non-validation cache related errors because caching should be optional
|
||||
+ // core.warning(`Failed to restore: ${error.message}`);
|
||||
+ // }
|
||||
+ // }
|
||||
finally {
|
||||
// Try to delete the archive to save space
|
||||
try {
|
||||
@@ -232,18 +234,20 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
||||
}
|
||||
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
||||
core.info('Cache restored successfully');
|
||||
- return response.matchedKey;
|
||||
- }
|
||||
- catch (error) {
|
||||
- const typedError = error;
|
||||
- if (typedError.name === ValidationError.name) {
|
||||
- throw error;
|
||||
- }
|
||||
- else {
|
||||
- // Supress all non-validation cache related errors because caching should be optional
|
||||
- core.warning(`Failed to restore: ${error.message}`);
|
||||
- }
|
||||
+ // PATCHED - Return more inforamtion about restored entry
|
||||
+ return new CacheEntry(response.matchedKey, archiveFileSize);;
|
||||
}
|
||||
+ // PATCHED - propagate errors
|
||||
+ // catch (error) {
|
||||
+ // const typedError = error;
|
||||
+ // if (typedError.name === ValidationError.name) {
|
||||
+ // throw error;
|
||||
+ // }
|
||||
+ // else {
|
||||
+ // // Supress all non-validation cache related errors because caching should be optional
|
||||
+ // core.warning(`Failed to restore: ${error.message}`);
|
||||
+ // }
|
||||
+ // }
|
||||
finally {
|
||||
try {
|
||||
if (archivePath) {
|
||||
@@ -334,19 +338,23 @@ function saveCacheV1(paths, key, options, enableCrossOsArchive = false) {
|
||||
}
|
||||
core.debug(`Saving Cache (ID: ${cacheId})`);
|
||||
yield cacheHttpClient.saveCache(cacheId, archivePath, '', options);
|
||||
+
|
||||
+ // PATCHED - Return more inforamtion about saved entry
|
||||
+ return new CacheEntry(key, archiveFileSize);
|
||||
}
|
||||
- catch (error) {
|
||||
- const typedError = error;
|
||||
- if (typedError.name === ValidationError.name) {
|
||||
- throw error;
|
||||
- }
|
||||
- else if (typedError.name === ReserveCacheError.name) {
|
||||
- core.info(`Failed to save: ${typedError.message}`);
|
||||
- }
|
||||
- else {
|
||||
- core.warning(`Failed to save: ${typedError.message}`);
|
||||
- }
|
||||
- }
|
||||
+ // PATCHED - propagate errors
|
||||
+ // catch (error) {
|
||||
+ // const typedError = error;
|
||||
+ // if (typedError.name === ValidationError.name) {
|
||||
+ // throw error;
|
||||
+ // }
|
||||
+ // else if (typedError.name === ReserveCacheError.name) {
|
||||
+ // core.info(`Failed to save: ${typedError.message}`);
|
||||
+ // }
|
||||
+ // else {
|
||||
+ // core.warning(`Failed to save: ${typedError.message}`);
|
||||
+ // }
|
||||
+ // }
|
||||
finally {
|
||||
// Try to delete the archive to save space
|
||||
try {
|
||||
@@ -422,19 +430,23 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
|
||||
throw new Error(`Unable to finalize cache with key ${key}, another job may be finalizing this cache.`);
|
||||
}
|
||||
cacheId = parseInt(finalizeResponse.entryId);
|
||||
+
|
||||
+ // PATCHED - Return more inforamtion about saved entry
|
||||
+ return new CacheEntry(key, archiveFileSize);
|
||||
}
|
||||
- catch (error) {
|
||||
- const typedError = error;
|
||||
- if (typedError.name === ValidationError.name) {
|
||||
- throw error;
|
||||
- }
|
||||
- else if (typedError.name === ReserveCacheError.name) {
|
||||
- core.info(`Failed to save: ${typedError.message}`);
|
||||
- }
|
||||
- else {
|
||||
- core.warning(`Failed to save: ${typedError.message}`);
|
||||
- }
|
||||
- }
|
||||
+ // PATCHED - propagate errors
|
||||
+ // catch (error) {
|
||||
+ // const typedError = error;
|
||||
+ // if (typedError.name === ValidationError.name) {
|
||||
+ // throw error;
|
||||
+ // }
|
||||
+ // else if (typedError.name === ReserveCacheError.name) {
|
||||
+ // core.info(`Failed to save: ${typedError.message}`);
|
||||
+ // }
|
||||
+ // else {
|
||||
+ // core.warning(`Failed to save: ${typedError.message}`);
|
||||
+ // }
|
||||
+ // }
|
||||
finally {
|
||||
// Try to delete the archive to save space
|
||||
try {
|
||||
@@ -447,4 +459,11 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
|
||||
return cacheId;
|
||||
});
|
||||
}
|
||||
+class CacheEntry {
|
||||
+ constructor(key, size) {
|
||||
+ this.key = key;
|
||||
+ this.size = size;
|
||||
+ }
|
||||
+}
|
||||
+exports.CacheEntry = CacheEntry;
|
||||
//# sourceMappingURL=cache.js.map
|
||||
\ No newline at end of file
|
Loading…
x
Reference in New Issue
Block a user