anthropics / anthropics/claude-code-action

Automatic Claude installation process become a error.

Đang mở
#477 1 bình luận 1 reaction 1 người được giao Được @ashwin-ant nhận Xem trên GitHub
area:installation bug p2
Ngôn ngữ chính
TypeScript
Star
8.9k
Fork
2.1k
Merge trung bình
3 ngày 9 giờ
Pull request đã merge (30 ngày)
10

Mô tả

**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 }}
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.