diff --git a/dist/index.js b/dist/index.js index 6f84eae..e418936 100644 Binary files a/dist/index.js and b/dist/index.js differ diff --git a/src/cache-save/run.ts b/src/cache-save/run.ts index 7481d58..8262a00 100644 --- a/src/cache-save/run.ts +++ b/src/cache-save/run.ts @@ -1,5 +1,6 @@ import { saveCache } from '@actions/cache' import { getState, info } from '@actions/core' +import { existsSync } from 'fs' export async function runSaveCache() { const state = getState('cache_restored_key') @@ -11,6 +12,11 @@ export async function runSaveCache() { return } + if (!existsSync(cachePath)) { + info(`Cache path ${cachePath} does not exist, not saving cache.`) + return + } + const cacheId = await saveCache([cachePath], primaryKey) if (cacheId == -1) return