anthropics / anthropics/claude-code-action
error: Cannot find module '@actions/core' from '/tmp/runner/work/_actions/anthropics/claude-code-action/main/src/entrypoints/prepare.ts'
- Vorherrschende Sprache
- TypeScript
- Sterne
- 8.9k
- Forks
- 2.1k
- Ø Merge
- 3 T. 9 Std.
- Gemergte PRs (30 T.)
- 10
Beschreibung
**Describe the bug**
The anthropics/claude-code-action@beta fails with "Cannot find module '@actions/core'" error when running on self-hosted runners
**To Reproduce**
Steps to reproduce the behavior:
1. Set up a self-hosted GitHub runner with Docker
2. Use the following workflow configuration with runs-on: self-hosted
3. Create an issue or PR comment with @claude trigger
4. See error in the action logs: error: Cannot find module '@actions/core' from '/tmp/runner/work/_actions/anthropics/claude-code-action/main/src/entrypoints/prepare.ts'
**Expected behavior**
The action should successfully find and load the @actions/core module after bun install completes, and proceed with the Claude code assistance.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Workflow yml file**
```
# claude-code-action.yml
name: Claude PR Assistant
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude-code-action:
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'))
runs-on: self-hosted
permissions:
contents: read
pull-requests: write
issues: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run Claude PR Action
uses: anthropics/claude-code-action@beta
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
timeout_minutes: "60"
mcp_config: |
{
"mcpServers": {
"sequential-thinking": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sequential-thinking"
]
}
}
}
allowed_tools: "mcp__sequential-thinking__sequentialthinking"
```
```
# docker-compose.yml
services:
github-runner:
build:
context: .
dockerfile: Dockerfile.runner
environment:
ORG_NAME: ${ORG_NAME}
RUNNER_TOKEN: ${RUNNER_TOKEN}
RUNNER_NAME: org-docker-runner-1
RUNNER_WORKDIR: /tmp/runner/work
RUNNER_GROUP: Default
LABELS: self-hosted,linux,x64,docker
RUNNER_SCOPE: org
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./work:/tmp/runner/work
restart: unless-stopped
```
```
# Dockerfile.runner
FROM myoung34/github-runner:latest
RUN apt-get update && apt-get install -y \
curl \
unzip \
build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g npm@latest
```
**API Provider**
[X] Anthropic First-Party API (default)
[ ] AWS Bedrock
[ ] GCP Vertex
**Additional context**
- This issue occurs specifically on self-hosted runners
- The same workflow works fine on GitHub-hosted runners (ubuntu-latest)
- Self-hosted runner environment: Docker container based on myoung34/github-runner:latest with Node.js 20.x installed
- The bun install command successfully installs all dependencies, but Bun cannot resolve the module path when executing the TypeScript file
- Tested with both @main and @beta versions of the action with the same result
- This appears to be a module resolution issue between Bun and the action's execution context in self-hosted environments
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.