68 lines
2.3 KiB
Markdown
68 lines
2.3 KiB
Markdown
# Claude Code Action Slim
|
|
|
|
A simplified, faster version of the Claude Code Gitea Action that eliminates redundant tool installations.
|
|
|
|
## Key Differences from Original
|
|
|
|
| Feature | Original | Slim |
|
|
|---------|----------|------|
|
|
| Bun install | Always downloads | Skips if pre-installed |
|
|
| Claude CLI install | Always downloads (twice!) | Skips if pre-installed |
|
|
| Base action | Calls `anthropics/claude-code-base-action` | Runs Claude directly |
|
|
| Dependencies | ~140KB + base-action | ~30KB |
|
|
| Typical startup | ~5-7 minutes | ~10 seconds (with custom container) |
|
|
|
|
## Performance Optimization
|
|
|
|
This action is designed to work with custom job containers that have Bun and Claude CLI pre-installed:
|
|
|
|
```yaml
|
|
# In your runner configuration
|
|
GITEA_RUNNER_LABELS: "ubuntu-latest:docker://ghcr.io/your-org/custom-job-container:latest"
|
|
```
|
|
|
|
Where your container Dockerfile includes:
|
|
```dockerfile
|
|
FROM catthehacker/ubuntu:act-latest
|
|
RUN curl -fsSL https://bun.sh/install | bash
|
|
RUN npm install -g @anthropic-ai/claude-code
|
|
```
|
|
|
|
## Usage
|
|
|
|
```yaml
|
|
- name: Run AtomicAI Assistant
|
|
uses: atomicqms-service/actions/claude-code-gitea-action-slim@main
|
|
with:
|
|
gitea_token: ${{ secrets.QMS_GITEA_TOKEN }}
|
|
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
trigger_phrase: '@atomicai'
|
|
```
|
|
|
|
## Inputs
|
|
|
|
| Input | Description | Default |
|
|
|-------|-------------|---------|
|
|
| `trigger_phrase` | Phrase to trigger the action | `@claude` |
|
|
| `gitea_token` | Gitea API token | - |
|
|
| `claude_code_oauth_token` | Claude OAuth token | - |
|
|
| `model` | Claude model to use | - |
|
|
| `timeout_minutes` | Execution timeout | `30` |
|
|
| `max_turns` | Max conversation turns | - |
|
|
| `allowed_tools` | Additional allowed tools | - |
|
|
| `disallowed_tools` | Blocked tools | - |
|
|
|
|
## How It Works
|
|
|
|
1. **Check for pre-installed tools** - Skips Bun/Claude install if already present
|
|
2. **Prepare action** - Check triggers, create tracking comment, setup branch
|
|
3. **Run Claude directly** - No base-action wrapper, direct CLI invocation
|
|
4. **Update comment** - Post results back to the issue/PR
|
|
|
|
## Files Changed from Original
|
|
|
|
- `action.yml` - Simplified steps, no base-action call
|
|
- `src/entrypoints/run-claude.ts` - New direct Claude runner
|
|
- `package.json` - Removed unused dependencies
|
|
- Removed `base-action/` directory entirely
|