From 9a602d2d82b8099cc19ba6de07d9795110e71b21 Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Sun, 22 May 2022 10:09:13 +0000 Subject: [PATCH] Adding check for cache paths' existence. --- src/cache.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cache.ts b/src/cache.ts index 86dd60c..e5b5f6a 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -158,6 +158,12 @@ export async function saveCache( core.debug('Cache Paths:') core.debug(`${JSON.stringify(cachePaths)}`) + + if(cachePaths.length === 0){ + throw new ValidationError( + `Path Validation Error: Path(s) specified in the action do not exist, hence no cache is being saved.`) + } + const archiveFolder = await utils.createTempDirectory() const archivePath = path.join( archiveFolder,