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

Function getPushEventRange

packages/bumpy/src/commands/ci.ts:926–940  ·  view source on GitHub ↗

Read the push event's before/after range, if running on a GitHub Actions push event

()

Source from the content-addressed store, hash-verified

924
925/** Read the push event's before/after range, if running on a GitHub Actions push event */
926function getPushEventRange(): { before: string; after: string } | null {
927 if (process.env.GITHUB_EVENT_NAME !== 'push') return null;
928 const path = process.env.GITHUB_EVENT_PATH;
929 if (!path) return null;
930 try {
931 const payload = JSON.parse(readFileSync(path, 'utf-8')) as { before?: string; after?: string };
932 // "before" is all zeros for branch-creation pushes — no usable range
933 if (payload.before && payload.after && !/^0+$/.test(payload.before)) {
934 return { before: payload.before, after: payload.after };
935 }
936 } catch {
937 // fall through
938 }
939 return null;
940}
941
942/**
943 * Bump file IDs added to `.bumpy/<channel>/` by the push that triggered this run.

Callers 2

detectChannelMovesFunction · 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…