(projectRoot, command)
| 78 | } |
| 79 | |
| 80 | function runVerification(projectRoot, command) { |
| 81 | if (!command) { |
| 82 | return { status: 'skipped', command: '', exitCode: null, stdout: '', stderr: '' }; |
| 83 | } |
| 84 | |
| 85 | const parts = splitCommand(command); |
| 86 | if (parts.length === 0) { |
| 87 | return { status: 'skipped', command, exitCode: null, stdout: '', stderr: '' }; |
| 88 | } |
| 89 | |
| 90 | const isWindowsNpm = process.platform === 'win32' && parts[0] === 'npm'; |
| 91 | const executable = isWindowsNpm ? 'cmd.exe' : parts[0]; |
| 92 | const commandArgs = isWindowsNpm ? ['/d', '/s', '/c', 'npm', ...parts.slice(1)] : parts.slice(1); |
| 93 | const result = spawnSync(executable, commandArgs, { |
| 94 | cwd: projectRoot, |
| 95 | encoding: 'utf8', |
| 96 | stdio: ['ignore', 'pipe', 'pipe'], |
| 97 | shell: false, |
| 98 | }); |
| 99 | |
| 100 | return { |
| 101 | status: result.status === 0 ? 'pass' : 'fail', |
| 102 | command, |
| 103 | exitCode: result.status ?? 1, |
| 104 | stdout: result.stdout || '', |
| 105 | stderr: result.stderr || '', |
| 106 | }; |
| 107 | } |
| 108 | |
| 109 | function validatePrUrl(pr) { |
| 110 | if (!pr) return 'missing pull request URL'; |
no test coverage detected