anthropics / anthropics/claude-code-action

Automatic Claude installation process become a error.

Ouverte
#477 1 commentaire 1 réaction 1 personne assignée Réclamée par @ashwin-ant Voir sur GitHub
area:installation bug p2
Langage dominant
TypeScript
Étoiles
8.9k
Forks
2.1k
Merge moyen
3 j 9 h
PR mergées (30 j)
10

Description

**Describe the bug**

This issue did not occur until a few days ago.
The automatic Claude installation process in anthropics/claude-code-action/beta has started producing errors.

> Setting up Claude settings at: /root/.claude/settings.json
> Creating .claude directory...
> No existing settings file found, creating new one
> Updated settings with enableAllProjectMcpServers: true
> Settings saved successfully
> Copying slash commands from /actions-runner/_work/_actions/anthropics/claude-code-action/beta/slash-commands to /root/.claude/
> Slash commands directory not found or error copying: ShellError: Failed with exit code 1
> Prompt file size: 144321 bytes
> Custom environment variables: GITHUB_ACTION_INPUTS
> Running Claude with prompt from file: /actions-runner/_work/_temp/claude-prompts/claude-prompt.txt
> Error spawning Claude process: 166 | catProcess.on("error", (error) => {
> 167 | console.error("Error reading prompt file:", error);
> 168 | pipeStream.destroy();
> 169 | });
> 170 |
> 171 | const claudeProcess = spawn("claude", config.claudeArgs, {
> ^
> error: Executable not found in $PATH: "claude"

**To Reproduce**
Steps to reproduce the behavior:

1. Just run the following workflow yml file

**Workflow yml file**

```
name: Claude Code

on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]

jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: [self-hosted, linux]
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Create Bun global directory
run: |
mkdir -p ~/.bun/bin
echo "BUN_INSTALL=$HOME/.bun" >> $GITHUB_ENV

- name: Add Bun to PATH
run: |
echo "$HOME/.bun/bin" >> $GITHUB_PATH
echo "PATH=$HOME/.bun/bin:$PATH" >> $GITHUB_ENV

- name: Verify Bun installation
run: |
bun --version
echo "Bun global directory: $HOME/.bun/install/global"
ls -la $HOME/.bun/bin || echo "Bun bin directory not found"

- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@beta
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.