From 0c5d98e6bb9d0fc9f4d425fed5a5a70556c880c7 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari <64764738+tiwarishub@users.noreply.github.com> Date: Sat, 25 Jun 2022 13:18:28 +0000 Subject: [PATCH] updated package version --- dist/restore/index.js | 48 +++++++++++-------------------------------- dist/save/index.js | 48 +++++++++++-------------------------------- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 27 insertions(+), 75 deletions(-) diff --git a/dist/restore/index.js b/dist/restore/index.js index cc1c684..11ea28b 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -46850,18 +46850,17 @@ function restoreCache(paths, primaryKey, restoreKeys, options) { checkKey(key); } const compressionMethod = yield utils.getCompressionMethod(); - let archivePath = ''; + // path are needed to compute version + const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { + compressionMethod + }); + if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { + // Cache not found + return undefined; + } + const archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core.debug(`Archive Path: ${archivePath}`); try { - // path are needed to compute version - const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { - compressionMethod - }); - if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { - // Cache not found - return undefined; - } - archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core.debug(`Archive Path: ${archivePath}`); // Download the cache from the cache entry yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); if (core.isDebug()) { @@ -46871,17 +46870,6 @@ function restoreCache(paths, primaryKey, restoreKeys, options) { core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); yield 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}`); - } } finally { // Try to delete the archive to save space @@ -46892,7 +46880,7 @@ function restoreCache(paths, primaryKey, restoreKeys, options) { core.debug(`Failed to delete archive: ${error}`); } } - return undefined; + return cacheEntry.cacheKey; }); } exports.restoreCache = restoreCache; @@ -46910,7 +46898,7 @@ function saveCache(paths, key, options) { checkPaths(paths); checkKey(key); const compressionMethod = yield utils.getCompressionMethod(); - let cacheId = -1; + let cacheId = null; const cachePaths = yield utils.resolvePaths(paths); core.debug('Cache Paths:'); core.debug(`${JSON.stringify(cachePaths)}`); @@ -46949,18 +46937,6 @@ function saveCache(paths, key, options) { core.debug(`Saving Cache (ID: ${cacheId})`); yield cacheHttpClient.saveCache(cacheId, archivePath, options); } - 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 { diff --git a/dist/save/index.js b/dist/save/index.js index 98c6833..ea80d22 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -46937,18 +46937,17 @@ function restoreCache(paths, primaryKey, restoreKeys, options) { checkKey(key); } const compressionMethod = yield utils.getCompressionMethod(); - let archivePath = ''; + // path are needed to compute version + const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { + compressionMethod + }); + if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { + // Cache not found + return undefined; + } + const archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core.debug(`Archive Path: ${archivePath}`); try { - // path are needed to compute version - const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { - compressionMethod - }); - if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { - // Cache not found - return undefined; - } - archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core.debug(`Archive Path: ${archivePath}`); // Download the cache from the cache entry yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); if (core.isDebug()) { @@ -46958,17 +46957,6 @@ function restoreCache(paths, primaryKey, restoreKeys, options) { core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); yield 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}`); - } } finally { // Try to delete the archive to save space @@ -46979,7 +46967,7 @@ function restoreCache(paths, primaryKey, restoreKeys, options) { core.debug(`Failed to delete archive: ${error}`); } } - return undefined; + return cacheEntry.cacheKey; }); } exports.restoreCache = restoreCache; @@ -46997,7 +46985,7 @@ function saveCache(paths, key, options) { checkPaths(paths); checkKey(key); const compressionMethod = yield utils.getCompressionMethod(); - let cacheId = -1; + let cacheId = null; const cachePaths = yield utils.resolvePaths(paths); core.debug('Cache Paths:'); core.debug(`${JSON.stringify(cachePaths)}`); @@ -47036,18 +47024,6 @@ function saveCache(paths, key, options) { core.debug(`Saving Cache (ID: ${cacheId})`); yield cacheHttpClient.saveCache(cacheId, archivePath, options); } - 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 { diff --git a/package-lock.json b/package-lock.json index de58c94..aca9407 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "3.0.4", "license": "MIT", "dependencies": { - "@actions/cache": "file:actions-cache-3.0.0.tgz", + "@actions/cache": "^3.0.0", "@actions/core": "^1.7.0", "@actions/exec": "^1.1.1", "@actions/io": "^1.1.2" @@ -9534,7 +9534,7 @@ }, "dependencies": { "@actions/cache": { - "version": "file:actions-cache-3.0.0.tgz", + "version": "3.0.0", "integrity": "sha512-LewCqxvgJr6DJjNAsIYI445b6crhMb+pkmWs8LdPsZ8jxA+3XRBI/RjLMRD0vgjUK4ZJwNF1sWF05nrhM6zfRw==", "requires": { "@actions/core": "^1.2.6", diff --git a/package.json b/package.json index 741f7e6..7c8bfaa 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "author": "GitHub", "license": "MIT", "dependencies": { - "@actions/cache": "file:actions-cache-3.0.0.tgz", + "@actions/cache": "^3.0.0", "@actions/core": "^1.7.0", "@actions/exec": "^1.1.1", "@actions/io": "^1.1.2"