From 99b6199758cdfbf100b4b389517a92ce59077753 Mon Sep 17 00:00:00 2001 From: Ashwin Bhat Date: Mon, 15 Dec 2025 08:55:27 -0800 Subject: [PATCH] fix: clean up stale lock files and validate installation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove ~/.claude/.locks before each retry attempt to prevent "another process is currently installing" errors after timeout - Validate claude binary is in PATH before reporting success - Add missing PATH setup to base-action/action.yml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- action.yml | 13 ++++++++++++- base-action/action.yml | 12 ++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 3aeb697e7..84fcb7f5e 100644 --- a/action.yml +++ b/action.yml @@ -202,6 +202,10 @@ runs: echo "Installing Claude Code v${CLAUDE_CODE_VERSION}..." for attempt in 1 2 3; do echo "Installation attempt $attempt..." + + # Clean up stale lock files before retry + rm -rf ~/.claude/.locks 2>/dev/null || true + if command -v timeout &> /dev/null; then timeout 120 bash -c "curl -fsSL https://claude.ai/install.sh | bash -s -- $CLAUDE_CODE_VERSION" && break else @@ -214,8 +218,15 @@ runs: echo "Installation failed, retrying..." sleep 5 done - echo "Claude Code installed successfully" + + # Add to PATH and validate installation echo "$HOME/.local/bin" >> "$GITHUB_PATH" + export PATH="$HOME/.local/bin:$PATH" + if ! command -v claude &> /dev/null; then + echo "Installation failed: claude binary not found in PATH" + exit 1 + fi + echo "Claude Code installed successfully" else echo "Using custom Claude Code executable: $PATH_TO_CLAUDE_CODE_EXECUTABLE" # Add the directory containing the custom executable to PATH diff --git a/base-action/action.yml b/base-action/action.yml index 1352b1057..8eeb8daf5 100644 --- a/base-action/action.yml +++ b/base-action/action.yml @@ -128,6 +128,10 @@ runs: echo "Installing Claude Code v${CLAUDE_CODE_VERSION}..." for attempt in 1 2 3; do echo "Installation attempt $attempt..." + + # Clean up stale lock files before retry + rm -rf ~/.claude/.locks 2>/dev/null || true + if command -v timeout &> /dev/null; then timeout 120 bash -c "curl -fsSL https://claude.ai/install.sh | bash -s -- $CLAUDE_CODE_VERSION" && break else @@ -140,6 +144,14 @@ runs: echo "Installation failed, retrying..." sleep 5 done + + # Add to PATH and validate installation + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + export PATH="$HOME/.local/bin:$PATH" + if ! command -v claude &> /dev/null; then + echo "Installation failed: claude binary not found in PATH" + exit 1 + fi echo "Claude Code installed successfully" else echo "Using custom Claude Code executable: $PATH_TO_CLAUDE_CODE_EXECUTABLE"