MCPcopy Create free account
hub / github.com/github/gh-aw / readEventPayload

Function readEventPayload

actions/setup/js/apply_samples.cjs:126–134  ·  view source on GitHub ↗

* 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}

()

Source from the content-addressed store, hash-verified

124 * @returns {Record<string, any>|null}
125 */
126function 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.

Callers 1

derivePrHeadRefFunction · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected