mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
All tests for this repo can be run with `bun test` - the test-local.sh script was a holdover from the base action repo. Fixes #172 Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Ashwin Bhat <ashwin-ant@users.noreply.github.com>
2.2 KiB
2.2 KiB
Contributing to Claude Code Action
Thank you for your interest in contributing to Claude Code Action! This document provides guidelines and instructions for contributing to the project.
Getting Started
Prerequisites
- Bun runtime
- Docker (for running GitHub Actions locally)
- act (installed automatically by our test script)
- An Anthropic API key (for testing)
Setup
-
Fork the repository on GitHub and clone your fork:
git clone https://github.com/your-username/claude-code-action.git cd claude-code-action -
Install dependencies:
bun install -
Set up your Anthropic API key:
export ANTHROPIC_API_KEY="your-api-key-here"
Development
Available Scripts
bun test- Run all testsbun run typecheck- Type check the codebun run format- Format code with Prettierbun run format:check- Check code formatting
Testing
Running Tests Locally
-
Unit Tests:
bun test
Pull Request Process
-
Create a new branch from
main:git checkout -b feature/your-feature-name -
Make your changes and commit them:
git add . git commit -m "feat: add new feature" -
Run tests and formatting:
bun test bun run typecheck bun run format:check -
Push your branch and create a Pull Request:
git push origin feature/your-feature-name -
Ensure all CI checks pass
-
Request review from maintainers
Action Development
Testing Your Changes
When modifying the action:
- Test in a real GitHub Actions workflow by:
- Creating a test repository
- Using your branch as the action source:
uses: your-username/claude-code-action@your-branch
Debugging
- Use
console.logfor debugging in development - Check GitHub Actions logs for runtime issues
- Use
actwith-vflag for verbose output:act push -v --secret ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY"
Common Issues
Docker Issues
Make sure Docker is running before using act. You can check with:
docker ps