From 4f3aee898decbddc9f238200612bb18fc723233d Mon Sep 17 00:00:00 2001 From: Bassem Dghaidi <568794+Link-@users.noreply.github.com> Date: Thu, 14 Nov 2024 04:06:04 -0800 Subject: [PATCH] Upgrade package to resolve security warning & upgrade to latest cache package --- dist/restore-only/index.js | 13 +++++-------- dist/restore/index.js | 13 +++++-------- dist/save-only/index.js | 13 +++++-------- dist/save/index.js | 13 +++++-------- package-lock.json | 34 ++++++++++++++++++---------------- 5 files changed, 38 insertions(+), 48 deletions(-) diff --git a/dist/restore-only/index.js b/dist/restore-only/index.js index 2f2d767..ed12faa 100644 --- a/dist/restore-only/index.js +++ b/dist/restore-only/index.js @@ -12639,7 +12639,6 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch return __awaiter(this, void 0, void 0, function* () { checkPaths(paths); const cacheServiceVersion = config.getCacheServiceVersion(); - console.debug(`Cache service version: ${cacheServiceVersion}`); switch (cacheServiceVersion) { case 'v2': return yield restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); @@ -12754,7 +12753,7 @@ function restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsAr workflowRunBackendId: backendIds.workflowRunBackendId, workflowJobRunBackendId: backendIds.workflowJobRunBackendId, key: primaryKey, - restoreKeys: restoreKeys, + restoreKeys, version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) }; core.debug(`GetCacheEntryDownloadURLRequest: ${JSON.stringify(twirpClient)}`); @@ -12793,7 +12792,6 @@ function restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsAr core.debug(`Failed to delete archive: ${error}`); } } - return undefined; }); } /** @@ -12810,7 +12808,6 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) { checkPaths(paths); checkKey(key); const cacheServiceVersion = config.getCacheServiceVersion(); - console.debug(`Cache Service Version: ${cacheServiceVersion}`); switch (cacheServiceVersion) { case 'v2': return yield saveCachev2(paths, key, options, enableCrossOsArchive); @@ -12939,8 +12936,8 @@ function saveCachev2(paths, key, options, enableCrossOsArchive = false) { const request = { workflowRunBackendId: backendIds.workflowRunBackendId, workflowJobRunBackendId: backendIds.workflowJobRunBackendId, - key: key, - version: version + key, + version }; const response = yield twirpClient.CreateCacheEntry(request); if (!response.ok) { @@ -12951,8 +12948,8 @@ function saveCachev2(paths, key, options, enableCrossOsArchive = false) { const finalizeRequest = { workflowRunBackendId: backendIds.workflowRunBackendId, workflowJobRunBackendId: backendIds.workflowJobRunBackendId, - key: key, - version: version, + key, + version, sizeBytes: `${archiveFileSize}` }; const finalizeResponse = yield twirpClient.FinalizeCacheEntryUpload(finalizeRequest); diff --git a/dist/restore/index.js b/dist/restore/index.js index 60a30f6..d8bf4a4 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -12639,7 +12639,6 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch return __awaiter(this, void 0, void 0, function* () { checkPaths(paths); const cacheServiceVersion = config.getCacheServiceVersion(); - console.debug(`Cache service version: ${cacheServiceVersion}`); switch (cacheServiceVersion) { case 'v2': return yield restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); @@ -12754,7 +12753,7 @@ function restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsAr workflowRunBackendId: backendIds.workflowRunBackendId, workflowJobRunBackendId: backendIds.workflowJobRunBackendId, key: primaryKey, - restoreKeys: restoreKeys, + restoreKeys, version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) }; core.debug(`GetCacheEntryDownloadURLRequest: ${JSON.stringify(twirpClient)}`); @@ -12793,7 +12792,6 @@ function restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsAr core.debug(`Failed to delete archive: ${error}`); } } - return undefined; }); } /** @@ -12810,7 +12808,6 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) { checkPaths(paths); checkKey(key); const cacheServiceVersion = config.getCacheServiceVersion(); - console.debug(`Cache Service Version: ${cacheServiceVersion}`); switch (cacheServiceVersion) { case 'v2': return yield saveCachev2(paths, key, options, enableCrossOsArchive); @@ -12939,8 +12936,8 @@ function saveCachev2(paths, key, options, enableCrossOsArchive = false) { const request = { workflowRunBackendId: backendIds.workflowRunBackendId, workflowJobRunBackendId: backendIds.workflowJobRunBackendId, - key: key, - version: version + key, + version }; const response = yield twirpClient.CreateCacheEntry(request); if (!response.ok) { @@ -12951,8 +12948,8 @@ function saveCachev2(paths, key, options, enableCrossOsArchive = false) { const finalizeRequest = { workflowRunBackendId: backendIds.workflowRunBackendId, workflowJobRunBackendId: backendIds.workflowJobRunBackendId, - key: key, - version: version, + key, + version, sizeBytes: `${archiveFileSize}` }; const finalizeResponse = yield twirpClient.FinalizeCacheEntryUpload(finalizeRequest); diff --git a/dist/save-only/index.js b/dist/save-only/index.js index bf3dc4c..5e0f5e9 100644 --- a/dist/save-only/index.js +++ b/dist/save-only/index.js @@ -12639,7 +12639,6 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch return __awaiter(this, void 0, void 0, function* () { checkPaths(paths); const cacheServiceVersion = config.getCacheServiceVersion(); - console.debug(`Cache service version: ${cacheServiceVersion}`); switch (cacheServiceVersion) { case 'v2': return yield restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); @@ -12754,7 +12753,7 @@ function restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsAr workflowRunBackendId: backendIds.workflowRunBackendId, workflowJobRunBackendId: backendIds.workflowJobRunBackendId, key: primaryKey, - restoreKeys: restoreKeys, + restoreKeys, version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) }; core.debug(`GetCacheEntryDownloadURLRequest: ${JSON.stringify(twirpClient)}`); @@ -12793,7 +12792,6 @@ function restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsAr core.debug(`Failed to delete archive: ${error}`); } } - return undefined; }); } /** @@ -12810,7 +12808,6 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) { checkPaths(paths); checkKey(key); const cacheServiceVersion = config.getCacheServiceVersion(); - console.debug(`Cache Service Version: ${cacheServiceVersion}`); switch (cacheServiceVersion) { case 'v2': return yield saveCachev2(paths, key, options, enableCrossOsArchive); @@ -12939,8 +12936,8 @@ function saveCachev2(paths, key, options, enableCrossOsArchive = false) { const request = { workflowRunBackendId: backendIds.workflowRunBackendId, workflowJobRunBackendId: backendIds.workflowJobRunBackendId, - key: key, - version: version + key, + version }; const response = yield twirpClient.CreateCacheEntry(request); if (!response.ok) { @@ -12951,8 +12948,8 @@ function saveCachev2(paths, key, options, enableCrossOsArchive = false) { const finalizeRequest = { workflowRunBackendId: backendIds.workflowRunBackendId, workflowJobRunBackendId: backendIds.workflowJobRunBackendId, - key: key, - version: version, + key, + version, sizeBytes: `${archiveFileSize}` }; const finalizeResponse = yield twirpClient.FinalizeCacheEntryUpload(finalizeRequest); diff --git a/dist/save/index.js b/dist/save/index.js index e88377e..a25655c 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -12639,7 +12639,6 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch return __awaiter(this, void 0, void 0, function* () { checkPaths(paths); const cacheServiceVersion = config.getCacheServiceVersion(); - console.debug(`Cache service version: ${cacheServiceVersion}`); switch (cacheServiceVersion) { case 'v2': return yield restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); @@ -12754,7 +12753,7 @@ function restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsAr workflowRunBackendId: backendIds.workflowRunBackendId, workflowJobRunBackendId: backendIds.workflowJobRunBackendId, key: primaryKey, - restoreKeys: restoreKeys, + restoreKeys, version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) }; core.debug(`GetCacheEntryDownloadURLRequest: ${JSON.stringify(twirpClient)}`); @@ -12793,7 +12792,6 @@ function restoreCachev2(paths, primaryKey, restoreKeys, options, enableCrossOsAr core.debug(`Failed to delete archive: ${error}`); } } - return undefined; }); } /** @@ -12810,7 +12808,6 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) { checkPaths(paths); checkKey(key); const cacheServiceVersion = config.getCacheServiceVersion(); - console.debug(`Cache Service Version: ${cacheServiceVersion}`); switch (cacheServiceVersion) { case 'v2': return yield saveCachev2(paths, key, options, enableCrossOsArchive); @@ -12939,8 +12936,8 @@ function saveCachev2(paths, key, options, enableCrossOsArchive = false) { const request = { workflowRunBackendId: backendIds.workflowRunBackendId, workflowJobRunBackendId: backendIds.workflowJobRunBackendId, - key: key, - version: version + key, + version }; const response = yield twirpClient.CreateCacheEntry(request); if (!response.ok) { @@ -12951,8 +12948,8 @@ function saveCachev2(paths, key, options, enableCrossOsArchive = false) { const finalizeRequest = { workflowRunBackendId: backendIds.workflowRunBackendId, workflowJobRunBackendId: backendIds.workflowJobRunBackendId, - key: key, - version: version, + key, + version, sizeBytes: `${archiveFileSize}` }; const finalizeResponse = yield twirpClient.FinalizeCacheEntryUpload(finalizeRequest); diff --git a/package-lock.json b/package-lock.json index db24505..c878f92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7806,13 +7806,14 @@ } }, "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.3", + "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" @@ -8111,10 +8112,11 @@ "dev": true }, "node_modules/picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -15165,13 +15167,13 @@ "dev": true }, "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.3", + "picomatch": "^2.3.1" } }, "mimic-fn": { @@ -15395,9 +15397,9 @@ "dev": true }, "picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, "pirates": {