diff --git a/packages/cache/src/cache.ts b/packages/cache/src/cache.ts index 7d0cd000..6567cabf 100644 --- a/packages/cache/src/cache.ts +++ b/packages/cache/src/cache.ts @@ -296,7 +296,9 @@ async function restoreCachev2( throw new Error(`Failed to restore: ${error.message}`) } finally { try { - await utils.unlinkFile(archivePath) + if (archivePath) { + await utils.unlinkFile(archivePath) + } } catch (error) { core.debug(`Failed to delete archive: ${error}`) }