mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-23 06:54: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>
117 lines
2.2 KiB
Markdown
117 lines
2.2 KiB
Markdown
# 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](https://bun.sh/) runtime
|
|
- [Docker](https://www.docker.com/) (for running GitHub Actions locally)
|
|
- [act](https://github.com/nektos/act) (installed automatically by our test script)
|
|
- An Anthropic API key (for testing)
|
|
|
|
### Setup
|
|
|
|
1. Fork the repository on GitHub and clone your fork:
|
|
|
|
```bash
|
|
git clone https://github.com/your-username/claude-code-action.git
|
|
cd claude-code-action
|
|
```
|
|
|
|
2. Install dependencies:
|
|
|
|
```bash
|
|
bun install
|
|
```
|
|
|
|
3. Set up your Anthropic API key:
|
|
```bash
|
|
export ANTHROPIC_API_KEY="your-api-key-here"
|
|
```
|
|
|
|
## Development
|
|
|
|
### Available Scripts
|
|
|
|
- `bun test` - Run all tests
|
|
- `bun run typecheck` - Type check the code
|
|
- `bun run format` - Format code with Prettier
|
|
- `bun run format:check` - Check code formatting
|
|
|
|
## Testing
|
|
|
|
### Running Tests Locally
|
|
|
|
1. **Unit Tests**:
|
|
|
|
```bash
|
|
bun test
|
|
```
|
|
|
|
## Pull Request Process
|
|
|
|
1. Create a new branch from `main`:
|
|
|
|
```bash
|
|
git checkout -b feature/your-feature-name
|
|
```
|
|
|
|
2. Make your changes and commit them:
|
|
|
|
```bash
|
|
git add .
|
|
git commit -m "feat: add new feature"
|
|
```
|
|
|
|
3. Run tests and formatting:
|
|
|
|
```bash
|
|
bun test
|
|
bun run typecheck
|
|
bun run format:check
|
|
```
|
|
|
|
4. Push your branch and create a Pull Request:
|
|
|
|
```bash
|
|
git push origin feature/your-feature-name
|
|
```
|
|
|
|
5. Ensure all CI checks pass
|
|
|
|
6. Request review from maintainers
|
|
|
|
## Action Development
|
|
|
|
### Testing Your Changes
|
|
|
|
When modifying the action:
|
|
|
|
1. Test in a real GitHub Actions workflow by:
|
|
- Creating a test repository
|
|
- Using your branch as the action source:
|
|
```yaml
|
|
uses: your-username/claude-code-action@your-branch
|
|
```
|
|
|
|
### Debugging
|
|
|
|
- Use `console.log` for debugging in development
|
|
- Check GitHub Actions logs for runtime issues
|
|
- Use `act` with `-v` flag for verbose output:
|
|
```bash
|
|
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:
|
|
|
|
```bash
|
|
docker ps
|
|
```
|