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

Function readGitHubEventPayload

packages/bumpy/src/commands/ci.ts:1809–1817  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1807 // both `pull_request` and `pull_request_target` (under `pull_request_target`,
1808 // GITHUB_REF points at the base branch, not refs/pull/N/merge).
1809 const eventName = process.env.GITHUB_EVENT_NAME;
1810 if (eventName === 'pull_request' || eventName === 'pull_request_target') {
1811 const event = readGitHubEventPayload();
1812 const num = event?.pull_request?.number;
1813 if (typeof num === 'number') return String(num);
1814 // Fallback for `pull_request`: parse GITHUB_REF if payload wasn't readable.
1815 if (eventName === 'pull_request') {
1816 const match = process.env.GITHUB_REF?.match(/refs\/pull\/(\d+)\//);
1817 if (match) return match[1]!;
1818 }
1819 }
1820 // Also check for explicit env var — validate it's numeric

Callers 3

resolveTargetPrNumberFunction · 0.85
detectPrNumberFunction · 0.85
isForkPrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…