CLAUDE.md
CLAUDE.mdCLAUDE.mdroot
Quality
79/100
Scores the file, not the repository.Length
397 words
9 headings · 0 code blocksRepository
71k
— · pushed 3 days agoLast changed
3 days ago
First indexed 3 days ago.1# CLAUDE.md23This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.45## Project Overview67Act is a tool to run GitHub Actions locally. It reads `.github/workflows/` files, builds an execution plan, and uses Docker to run containers for each action. Written in Go 1.24+.89## Common Commands1011- `make build` — build binary to `dist/local/act`12- `make test` — run `go test ./...` and the act CLI13- `make lint-go` — run `golangci-lint run`14- `make format` — run `go fmt ./...`15- `make tidy` — run `go mod tidy`16- `make pr` — full PR checklist: tidy, format-all, lint, test17- `go test ./pkg/runner/...` — run tests for a single package18- `go test ./pkg/runner/ -run TestRunEvent` — run a single test1920## Architecture2122### Execution Flow23241. **CLI** (`cmd/root.go`) — Cobra-based CLI parses flags into an `Input` struct252. **Planner** (`pkg/model/planner.go`) — parses workflow YAML into a `Plan` containing `Stage`s (serial) with `Run`s (parallel jobs)263. **Runner** (`pkg/runner/runner.go`) — converts the Plan into composable `Executor` chains274. **RunContext** (`pkg/runner/run_context.go`) — holds all state for a job execution (env vars, matrix, containers, expressions)285. **Steps** (`pkg/runner/step.go`) — each step type (action, docker, script) implements the `step` interface2930### Core Abstraction: Executor Pattern3132The `Executor` type (`pkg/common/executor.go`) is a `func(ctx context.Context) error` used throughout the codebase. Executors compose via:3334- `.Then()`, `.Finally()`, `.OnError()` — chaining35- `NewPipelineExecutor()` — serial execution36- `NewParallelExecutor()` — parallel execution37- `.If()`, `.IfNot()` — conditional execution3839### Key Packages4041- **`pkg/model/`** — workflow YAML parsing, plan creation, action definitions42- **`pkg/runner/`** — core execution engine, expression evaluation, step types (local/remote/docker/composite actions, reusable workflows)43- **`pkg/container/`** — Docker API wrapper, container and host execution environments44- **`pkg/common/`** — Executor pattern, context utilities, logging45- **`pkg/exprparser/`** — GitHub Actions `${{ }}` expression language interpreter46- **`pkg/artifacts/`** and **`pkg/artifactcache/`** — artifact upload/download and caching server4748## Linting Rules4950Configured in `.golangci.yml`:5152- Use `errors` from stdlib, not `github.com/pkg/errors`53- Use `github.com/sirupsen/logrus` (aliased as `log`), not stdlib `log`54- Use `github.com/stretchr/testify` for tests, not `gotest.tools/v3`55- Max cyclomatic complexity: 2056- Import aliases enforced: `logrus` → `log`, `testify/assert` → `assert`5758## Testing5960- Tests use `testify/assert` and `testify/mock`61- Table-driven tests are common in `pkg/model/` and `pkg/exprparser/`62- Test fixtures live in `testdata/` directories alongside their packages63- `pkg/runner/testdata/` contains extensive sample GitHub Actions workflows used as integration test fixtures64
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| bagisto/bagistoCLAUDE.md · 28k | CLAUDE.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| filamentphp/filamentCLAUDE.md · 32k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| dotCMS/corecore-web/CLAUDE.md · 949 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 3 days ago | |
| nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.4k | CLAUDE.md | setupbuildstylearch+2 | 100/100 | 3 days ago | |
| microsoft/playwrightCLAUDE.md · 94k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| Adit-Jain-srm/NightmareNetCLAUDE.md · 45 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 3 days ago | |
| stacklok/toolhiveCLAUDE.md · 2.0k | CLAUDE.md | buildteststylearch+4 | 100/100 | 3 days ago | |
| dotCMS/coreCLAUDE.md · 949 | CLAUDE.md | setupbuildteststyle+7 | 99/100 | today |
