Some checks failed
Test Custom Executables / test-custom-executables (push) Has been cancelled
CI / test (push) Has been cancelled
CI / prettier (push) Has been cancelled
CI / typecheck (push) Has been cancelled
Sync Base Action to claude-code-base-action / Sync base-action to claude-code-base-action repository (push) Has been cancelled
Test Claude Code Action / test-inline-prompt (push) Has been cancelled
Test Claude Code Action / test-prompt-file (push) Has been cancelled
Test Claude Env Feature / test-claude-env-with-comments (push) Has been cancelled
Test MCP Servers / test-mcp-integration (push) Has been cancelled
Test MCP Servers / test-mcp-config-flag (push) Has been cancelled
Test Settings Feature / test-settings-inline-allow (push) Has been cancelled
Test Settings Feature / test-settings-inline-deny (push) Has been cancelled
Test Settings Feature / test-settings-file-allow (push) Has been cancelled
Test Settings Feature / test-settings-file-deny (push) Has been cancelled
Fork of markwylde/claude-code-gitea-action@b744372 (v1.0.21) with the 'View job' link fixed to use GITHUB_RUN_NUMBER (per-repo index) instead of GITHUB_RUN_ID (global id), because Forgejo routes run pages by per-repo index. See VENDOR.txt.
1.9 KiB
1.9 KiB
CLAUDE.md
Common Commands
Development Commands
- Build/Type check:
bun run typecheck - Format code:
bun run format - Check formatting:
bun run format:check - Run tests:
bun test - Install dependencies:
bun install
Action Testing
- Test action locally:
./test-local.sh - Test specific file:
bun test test/prepare-prompt.test.ts
Architecture Overview
This is a GitHub Action that allows running Claude Code within GitHub workflows. The action consists of:
Core Components
- Action Definition (
action.yml): Defines inputs, outputs, and the composite action steps - Prompt Preparation (
src/index.ts): Runs Claude Code with specified arguments
Key Design Patterns
- Uses Bun runtime for development and execution
- Named pipes for IPC between prompt input and Claude process
- JSON streaming output format for execution logs
- Composite action pattern to orchestrate multiple steps
- Provider-agnostic design supporting Anthropic API, AWS Bedrock, and Google Vertex AI
Provider Authentication
- Anthropic API (default): Requires API key via
anthropic_api_keyinput - AWS Bedrock: Uses OIDC authentication when
use_bedrock: true - Google Vertex AI: Uses OIDC authentication when
use_vertex: true
Testing Strategy
Local Testing
- Use
acttool to run GitHub Actions workflows locally test-local.shscript automates local testing setup- Requires
ANTHROPIC_API_KEYenvironment variable
Test Structure
- Unit tests for configuration logic
- Integration tests for prompt preparation
- Full workflow tests in
.github/workflows/test-action.yml
Important Technical Details
- Uses
mkfifoto create named pipes for prompt input - Outputs execution logs as JSON to
/tmp/claude-execution-output.json - Timeout enforcement via
timeoutcommand wrapper - Strict TypeScript configuration with Bun-specific settings