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

Function resolveMcpServerPath

actions/setup/js/apply_samples.cjs:476–488  ·  view source on GitHub ↗

* Locate the safe_outputs_mcp_server.cjs script. The setup action copies it * into ${RUNNER_TEMP}/gh-aw/actions/ alongside this driver; fall back to * resolving via __dirname for local-execution / tests. * @returns {string}

()

Source from the content-addressed store, hash-verified

474 * @returns {string}
475 */
476function resolveMcpServerPath() {
477 const candidates = [
478 path.join(__dirname, "safe_outputs_mcp_server.cjs"),
479 process.env.RUNNER_TEMP ? path.join(process.env.RUNNER_TEMP, "gh-aw", "actions", "safe_outputs_mcp_server.cjs") : null,
480 process.env.RUNNER_TEMP ? path.join(process.env.RUNNER_TEMP, "gh-aw", "safeoutputs", "safe_outputs_mcp_server.cjs") : null,
481 ].filter(/** @returns {p is string} */ p => typeof p === "string");
482 for (const candidate of candidates) {
483 if (fs.existsSync(candidate)) {
484 return candidate;
485 }
486 }
487 throw new Error(`${ERR_CONFIG}: apply_samples: could not locate safe_outputs_mcp_server.cjs. Looked in: ${candidates.join(", ")}`);
488}
489
490/**
491 * Return true when an MCP tool-call result carries an application-level error

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected