diff --git a/dist/post_run/index.js b/dist/post_run/index.js index d9d1010..9f095fa 100644 --- a/dist/post_run/index.js +++ b/dist/post_run/index.js @@ -142,6 +142,9 @@ function saveCache(paths, key, options) { const cachePaths = yield utils.resolvePaths(paths); core.debug('Cache Paths:'); core.debug(`${JSON.stringify(cachePaths)}`); + if (cachePaths.length === 0) { + throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); + } const archiveFolder = yield utils.createTempDirectory(); const archivePath = path.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core.debug(`Archive Path: ${archivePath}`); diff --git a/dist/run/index.js b/dist/run/index.js index ff0df9a..e306e25 100644 --- a/dist/run/index.js +++ b/dist/run/index.js @@ -142,6 +142,9 @@ function saveCache(paths, key, options) { const cachePaths = yield utils.resolvePaths(paths); core.debug('Cache Paths:'); core.debug(`${JSON.stringify(cachePaths)}`); + if (cachePaths.length === 0) { + throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); + } const archiveFolder = yield utils.createTempDirectory(); const archivePath = path.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core.debug(`Archive Path: ${archivePath}`);