fix cache throwing error on missing lockfile

This commit is contained in:
Florian Hübner 2023-02-12 16:34:57 +01:00
parent a3d889c34c
commit 4e210ad7a2

View file

@ -18,9 +18,16 @@ export const restoreCache = async (
const cachePaths = await getCacheDirectoryPath(packageManagerInfo); const cachePaths = await getCacheDirectoryPath(packageManagerInfo);
const dependencyFilePath = cacheDependencyPath let dependencyFilePath: string
? cacheDependencyPath try {
: findDependencyFile(packageManagerInfo); dependencyFilePath = cacheDependencyPath
? cacheDependencyPath
: findDependencyFile(packageManagerInfo);
} catch (e) {
core.info(e);
core.setOutput(Outputs.CacheHit, false);
return;
}
const fileHash = await glob.hashFiles(dependencyFilePath); const fileHash = await glob.hashFiles(dependencyFilePath);
if (!fileHash) { if (!fileHash) {