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)
| 560 | // JSONL compatible with parse_pi_log.cjs to stdout; stderr and stdout are both |
| 561 | // captured by tee to PiStreamingLogFile. |
| 562 | func 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 | } |