Skip to content

Commit 0f3a1bf

Browse files
anandgupta42claude
andcommitted
fix: use full path for altimate-code binary in CLI wrapper
GITHUB_PATH modifications in composite actions only take effect for the NEXT step. The node process running dist/index.js couldn't find altimate-code on PATH because the PATH update hadn't propagated. Now checks ~/.altimate-code/bin/altimate-code first (where the action installs it), falls back to PATH lookup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9eeb108 commit 0f3a1bf

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

dist/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27473,7 +27473,8 @@ import { spawn } from "node:child_process";
2747327473
var DEFAULT_TIMEOUT_MS = 3e5;
2747427474
async function runCLI(args, options = {}) {
2747527475
const { env: extraEnv = {}, cwd, timeout = DEFAULT_TIMEOUT_MS, parseJson = false } = options;
27476-
const command = "altimate-code";
27476+
const homeBin = `${process.env.HOME}/.altimate-code/bin/altimate-code`;
27477+
const command = process.env.HOME && __require("fs").existsSync(homeBin) ? homeBin : "altimate-code";
2747727478
core3.debug(`Running CLI: ${command} ${args.join(" ")}`);
2747827479
return new Promise((resolve2, reject) => {
2747927480
const child = spawn(command, args, {

dist/index.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/util/cli.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ interface CLIOptions {
2525
export async function runCLI(args: string[], options: CLIOptions = {}): Promise<CLIResult> {
2626
const { env: extraEnv = {}, cwd, timeout = DEFAULT_TIMEOUT_MS, parseJson = false } = options;
2727

28-
const command = "altimate-code";
28+
// Try full path first (GitHub Actions installs to ~/.altimate-code/bin/),
29+
// then fall back to PATH lookup
30+
const homeBin = `${process.env.HOME}/.altimate-code/bin/altimate-code`;
31+
const command =
32+
process.env.HOME && require("fs").existsSync(homeBin) ? homeBin : "altimate-code";
2933
core.debug(`Running CLI: ${command} ${args.join(" ")}`);
3034

3135
return new Promise<CLIResult>((resolve, reject) => {

0 commit comments

Comments
 (0)