* Read and parse the GitHub Actions event payload from GITHUB_EVENT_PATH. * Returns null when the file is unset, missing, or not parseable. * @returns {Record |null}
()
| 124 | * @returns {Record<string, any>|null} |
| 125 | */ |
| 126 | function readEventPayload() { |
| 127 | const p = process.env.GITHUB_EVENT_PATH; |
| 128 | if (!p) return null; |
| 129 | try { |
| 130 | return JSON.parse(fs.readFileSync(p, "utf8")); |
| 131 | } catch { |
| 132 | return null; |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * Resolve the best token for a `owner/repo` API call. |
no test coverage detected