Read the push event's before/after range, if running on a GitHub Actions push event
()
| 924 | |
| 925 | /** Read the push event's before/after range, if running on a GitHub Actions push event */ |
| 926 | function 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. |
no outgoing calls
no test coverage detected
searching dependent graphs…