mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-24 15:34:13 +08:00
Compare commits
4 Commits
v1.0.19
...
ashwin/tim
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6626337d20 | ||
|
|
ed4a4d26bc | ||
|
|
798cf0988d | ||
|
|
8458f4399d |
26
action.yml
26
action.yml
@@ -195,8 +195,30 @@ runs:
|
|||||||
|
|
||||||
# Install Claude Code if no custom executable is provided
|
# Install Claude Code if no custom executable is provided
|
||||||
if [ -z "${{ inputs.path_to_claude_code_executable }}" ]; then
|
if [ -z "${{ inputs.path_to_claude_code_executable }}" ]; then
|
||||||
echo "Installing Claude Code..."
|
CLAUDE_CODE_VERSION="2.0.50"
|
||||||
curl -fsSL https://claude.ai/install.sh | bash -s 2.0.49
|
echo "Installing Claude Code v${CLAUDE_CODE_VERSION}..."
|
||||||
|
for attempt in 1 2 3; do
|
||||||
|
echo "Installation attempt $attempt..."
|
||||||
|
# Cross-platform timeout (GNU timeout not available on macOS)
|
||||||
|
(curl -fsSL https://claude.ai/install.sh | bash -s -- "$CLAUDE_CODE_VERSION") &
|
||||||
|
install_pid=$!
|
||||||
|
( sleep 120; kill $install_pid 2>/dev/null ) &
|
||||||
|
timeout_pid=$!
|
||||||
|
if wait $install_pid 2>/dev/null; then
|
||||||
|
kill $timeout_pid 2>/dev/null || true
|
||||||
|
wait $timeout_pid 2>/dev/null || true
|
||||||
|
echo "Claude Code installed successfully"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
kill $timeout_pid 2>/dev/null || true
|
||||||
|
wait $timeout_pid 2>/dev/null || true
|
||||||
|
if [ $attempt -eq 3 ]; then
|
||||||
|
echo "Failed to install Claude Code after 3 attempts"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Installation timed out or failed, retrying..."
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||||
else
|
else
|
||||||
echo "Using custom Claude Code executable: ${{ inputs.path_to_claude_code_executable }}"
|
echo "Using custom Claude Code executable: ${{ inputs.path_to_claude_code_executable }}"
|
||||||
|
|||||||
@@ -117,8 +117,30 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [ -z "${{ inputs.path_to_claude_code_executable }}" ]; then
|
if [ -z "${{ inputs.path_to_claude_code_executable }}" ]; then
|
||||||
echo "Installing Claude Code..."
|
CLAUDE_CODE_VERSION="2.0.50"
|
||||||
curl -fsSL https://claude.ai/install.sh | bash -s 2.0.49
|
echo "Installing Claude Code v${CLAUDE_CODE_VERSION}..."
|
||||||
|
for attempt in 1 2 3; do
|
||||||
|
echo "Installation attempt $attempt..."
|
||||||
|
# Cross-platform timeout (GNU timeout not available on macOS)
|
||||||
|
(curl -fsSL https://claude.ai/install.sh | bash -s -- "$CLAUDE_CODE_VERSION") &
|
||||||
|
install_pid=$!
|
||||||
|
( sleep 120; kill $install_pid 2>/dev/null ) &
|
||||||
|
timeout_pid=$!
|
||||||
|
if wait $install_pid 2>/dev/null; then
|
||||||
|
kill $timeout_pid 2>/dev/null || true
|
||||||
|
wait $timeout_pid 2>/dev/null || true
|
||||||
|
echo "Claude Code installed successfully"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
kill $timeout_pid 2>/dev/null || true
|
||||||
|
wait $timeout_pid 2>/dev/null || true
|
||||||
|
if [ $attempt -eq 3 ]; then
|
||||||
|
echo "Failed to install Claude Code after 3 attempts"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Installation timed out or failed, retrying..."
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
else
|
else
|
||||||
echo "Using custom Claude Code executable: ${{ inputs.path_to_claude_code_executable }}"
|
echo "Using custom Claude Code executable: ${{ inputs.path_to_claude_code_executable }}"
|
||||||
# Add the directory containing the custom executable to PATH
|
# Add the directory containing the custom executable to PATH
|
||||||
|
|||||||
Reference in New Issue
Block a user