MCPcopy Create free account
hub / github.com/dmno-dev/bumpy / lookupPr

Function lookupPr

packages/bumpy/src/core/changelog-github.ts:232–249  ·  view source on GitHub ↗

Look up a PR by number using gh CLI

(prNumber: number, repo?: string)

Source from the content-addressed store, hash-verified

230
231/** Look up a PR by number using gh CLI */
232function lookupPr(prNumber: number, repo?: string): { url: string; author?: string; commitHash?: string } | null {
233 try {
234 const ghArgs = ['gh', 'pr', 'view', String(prNumber), '--json', 'url,author,mergeCommit'];
235 if (repo) ghArgs.push('--repo', repo);
236
237 const result = tryRunArgs(ghArgs);
238 if (!result) return null;
239
240 const pr = JSON.parse(result);
241 return {
242 url: pr.url,
243 author: pr.author?.login,
244 commitHash: pr.mergeCommit?.oid,
245 };
246 } catch {
247 return null;
248 }
249}
250
251/**
252 * Find the PR that introduced a bump file by checking git log

Callers 1

resolveBumpFileInfoFunction · 0.85

Calls 1

tryRunArgsFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…