(args, opts)
| 252 | } |
| 253 | |
| 254 | function runGh(args, opts) { |
| 255 | const timeoutMs = (opts && opts.timeoutMs) || SELF_PR_TIMEOUT_MS; |
| 256 | const cwd = (opts && opts.cwd) || getRepoRoot(); |
| 257 | try { |
| 258 | const result = execSync('gh ' + args, { |
| 259 | cwd: cwd, |
| 260 | timeout: timeoutMs, |
| 261 | encoding: 'utf8', |
| 262 | stdio: ['pipe', 'pipe', 'pipe'], |
| 263 | env: Object.assign({}, process.env), maxBuffer: MAX_EXEC_BUFFER |
| 264 | }); |
| 265 | return { ok: true, out: String(result || '').trim() }; |
| 266 | } catch (e) { |
| 267 | return { ok: false, out: '', err: String(e && e.stderr ? e.stderr : e.message || e).slice(0, 500) }; |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | function getGitDiff(changedFiles, repoRoot) { |
| 272 | const parts = []; |
no test coverage detected