MCPcopy Index your code
hub / github.com/actions/setup-node / findLockFile

Function findLockFile

src/cache-restore.ts:74–88  ·  view source on GitHub ↗
(packageManager: PackageManagerInfo)

Source from the content-addressed store, hash-verified

72};
73
74const findLockFile = (packageManager: PackageManagerInfo) => {
75 const lockFiles = packageManager.lockFilePatterns;
76 const workspace = process.env.GITHUB_WORKSPACE!;
77
78 const rootContent = fs.readdirSync(workspace);
79
80 const lockFile = lockFiles.find(item => rootContent.includes(item));
81 if (!lockFile) {
82 throw new Error(
83 `Dependencies lock file is not found in ${workspace}. Supported file patterns: ${lockFiles.toString()}`
84 );
85 }
86
87 return path.join(workspace, lockFile);
88};

Callers 1

restoreCacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected