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

Function buildPiDriverCommand

pkg/workflow/pi_engine.go:562–573  ·  view source on GitHub ↗

buildPiDriverCommand builds the shell command to run a pi engine driver script. When driverName contains a path separator ('/'), it is treated as a workspace-relative custom driver: "${GITHUB_WORKSPACE}/ ". When it is a bare filename (no '/'), it is resolved from the setup-action direct

(driverName string)

Source from the content-addressed store, hash-verified

560// JSONL compatible with parse_pi_log.cjs to stdout; stderr and stdout are both
561// captured by tee to PiStreamingLogFile.
562func buildPiDriverCommand(driverName string) string {
563 var driverPath string
564 if strings.Contains(driverName, "/") {
565 // Workspace-relative custom driver: validation ensures no shell metacharacters or
566 // path traversal, so embedding directly in a double-quoted shell argument is safe.
567 driverPath = `"${GITHUB_WORKSPACE}/` + driverName + `"`
568 } else {
569 driverPath = fmt.Sprintf(`"%s/%s"`, SetupActionDestinationShell, driverName)
570 }
571
572 return fmt.Sprintf(`%s %s 2>&1 | tee %s`, nodeRuntimeResolutionCommand, driverPath, PiStreamingLogFile)
573}

Callers 1

GetExecutionStepsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected