Compare commits

...

2 Commits

Author SHA1 Message Date
Ashwin Bhat
6626337d20 fix: suppress exit code from killed timeout watchdog process
When killing the timeout watchdog process after successful installation,
`wait` returns exit code 143 (SIGTERM). Add `|| true` to prevent this
from causing the step to fail.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 20:52:16 -05:00
Ashwin Bhat
ed4a4d26bc fix: use cross-platform timeout for Claude Code installation
The GNU `timeout` command is not available on macOS, which breaks
the action on macOS self-hosted runners. Replace with a portable
bash approach using background process management.

Also extracts the version into a CLAUDE_CODE_VERSION variable for
easier maintenance.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 20:45:51 -05:00
2 changed files with 24 additions and 4 deletions

View File

@@ -195,13 +195,23 @@ 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"
echo "Installing Claude Code v${CLAUDE_CODE_VERSION}..."
for attempt in 1 2 3; do for attempt in 1 2 3; do
echo "Installation attempt $attempt..." echo "Installation attempt $attempt..."
if timeout 120 bash -c 'curl -fsSL https://claude.ai/install.sh | bash -s -- 2.0.50'; then # 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" echo "Claude Code installed successfully"
break break
fi fi
kill $timeout_pid 2>/dev/null || true
wait $timeout_pid 2>/dev/null || true
if [ $attempt -eq 3 ]; then if [ $attempt -eq 3 ]; then
echo "Failed to install Claude Code after 3 attempts" echo "Failed to install Claude Code after 3 attempts"
exit 1 exit 1

View File

@@ -117,13 +117,23 @@ 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"
echo "Installing Claude Code v${CLAUDE_CODE_VERSION}..."
for attempt in 1 2 3; do for attempt in 1 2 3; do
echo "Installation attempt $attempt..." echo "Installation attempt $attempt..."
if timeout 120 bash -c 'curl -fsSL https://claude.ai/install.sh | bash -s -- 2.0.50'; then # 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" echo "Claude Code installed successfully"
break break
fi fi
kill $timeout_pid 2>/dev/null || true
wait $timeout_pid 2>/dev/null || true
if [ $attempt -eq 3 ]; then if [ $attempt -eq 3 ]; then
echo "Failed to install Claude Code after 3 attempts" echo "Failed to install Claude Code after 3 attempts"
exit 1 exit 1