(packageManager: PackageManagerInfo)
| 72 | }; |
| 73 | |
| 74 | const 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 | }; |