mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-03 06:18:55 +00:00
fix(ci): resolve self-hosted Claude path dynamically
This commit is contained in:
@@ -451,15 +451,29 @@ jobs:
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CLAUDE_PATH="/root/.local/bin/claude"
|
CANDIDATES=()
|
||||||
|
|
||||||
if [ ! -x "$CLAUDE_PATH" ]; then
|
if command -v claude >/dev/null 2>&1; then
|
||||||
echo "::error::Missing self-hosted Claude executable at $CLAUDE_PATH"
|
CANDIDATES+=("$(command -v claude)")
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"$CLAUDE_PATH" --version
|
CANDIDATES+=(
|
||||||
echo "claude_path=$CLAUDE_PATH" >> "$GITHUB_OUTPUT"
|
"/home/github-runner/.local/bin/claude"
|
||||||
|
"/root/.local/bin/claude"
|
||||||
|
)
|
||||||
|
|
||||||
|
for CLAUDE_PATH in "${CANDIDATES[@]}"; do
|
||||||
|
[ -n "$CLAUDE_PATH" ] || continue
|
||||||
|
|
||||||
|
if [ -x "$CLAUDE_PATH" ]; then
|
||||||
|
"$CLAUDE_PATH" --version
|
||||||
|
echo "claude_path=$CLAUDE_PATH" >> "$GITHUB_OUTPUT"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "::error::Missing self-hosted Claude executable. Checked: ${CANDIDATES[*]}"
|
||||||
|
exit 1
|
||||||
|
|
||||||
- name: Run Claude Code Review
|
- name: Run Claude Code Review
|
||||||
id: claude-review
|
id: claude-review
|
||||||
|
|||||||
@@ -22,8 +22,10 @@ describe('ai-review workflow', () => {
|
|||||||
const toolchainStep = steps.find((step) => step.id === 'toolchain');
|
const toolchainStep = steps.find((step) => step.id === 'toolchain');
|
||||||
expect(toolchainStep).toBeDefined();
|
expect(toolchainStep).toBeDefined();
|
||||||
expect(toolchainStep?.name).toBe('Resolve self-hosted Claude executable');
|
expect(toolchainStep?.name).toBe('Resolve self-hosted Claude executable');
|
||||||
expect(toolchainStep?.run).toContain('CLAUDE_PATH="/root/.local/bin/claude"');
|
expect(toolchainStep?.run).toContain('command -v claude');
|
||||||
expect(toolchainStep?.run).toContain('Missing self-hosted Claude executable');
|
expect(toolchainStep?.run).toContain('"/home/github-runner/.local/bin/claude"');
|
||||||
|
expect(toolchainStep?.run).toContain('"/root/.local/bin/claude"');
|
||||||
|
expect(toolchainStep?.run).toContain('Missing self-hosted Claude executable. Checked:');
|
||||||
expect(toolchainStep?.run).toContain('echo "claude_path=$CLAUDE_PATH" >> "$GITHUB_OUTPUT"');
|
expect(toolchainStep?.run).toContain('echo "claude_path=$CLAUDE_PATH" >> "$GITHUB_OUTPUT"');
|
||||||
|
|
||||||
const claudeReviewStep = steps.find((step) => step.id === 'claude-review');
|
const claudeReviewStep = steps.find((step) => step.id === 'claude-review');
|
||||||
|
|||||||
Reference in New Issue
Block a user