mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 02:11:28 +00:00
fix(ci): resolve self-hosted Claude path dynamically
This commit is contained in:
@@ -451,15 +451,29 @@ jobs:
|
||||
exit 0
|
||||
fi
|
||||
|
||||
CLAUDE_PATH="/root/.local/bin/claude"
|
||||
CANDIDATES=()
|
||||
|
||||
if [ ! -x "$CLAUDE_PATH" ]; then
|
||||
echo "::error::Missing self-hosted Claude executable at $CLAUDE_PATH"
|
||||
exit 1
|
||||
if command -v claude >/dev/null 2>&1; then
|
||||
CANDIDATES+=("$(command -v claude)")
|
||||
fi
|
||||
|
||||
"$CLAUDE_PATH" --version
|
||||
echo "claude_path=$CLAUDE_PATH" >> "$GITHUB_OUTPUT"
|
||||
CANDIDATES+=(
|
||||
"/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
|
||||
id: claude-review
|
||||
|
||||
@@ -22,8 +22,10 @@ describe('ai-review workflow', () => {
|
||||
const toolchainStep = steps.find((step) => step.id === 'toolchain');
|
||||
expect(toolchainStep).toBeDefined();
|
||||
expect(toolchainStep?.name).toBe('Resolve self-hosted Claude executable');
|
||||
expect(toolchainStep?.run).toContain('CLAUDE_PATH="/root/.local/bin/claude"');
|
||||
expect(toolchainStep?.run).toContain('Missing self-hosted Claude executable');
|
||||
expect(toolchainStep?.run).toContain('command -v claude');
|
||||
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"');
|
||||
|
||||
const claudeReviewStep = steps.find((step) => step.id === 'claude-review');
|
||||
|
||||
Reference in New Issue
Block a user