How to run CI locally with act
Execute the real GitHub workflows on your workstation with act — no secrets, no GitHub writes.
You want to know whether a change would pass the real CI workflows without
pushing. The repository ships a local act environment for exactly that.
The commands
mise run ci:act # CI workflow: Go (ubuntu leg), quality, lint, security
ACT_INCLUDE_DOCS=1 mise run ci:act # also the docs job
mise run release:act-dry-run # release workflow as a GoReleaser snapshotci:act runs scripts/act-ci.sh; release:act-dry-run runs
scripts/act-release-dry-run.sh. Both require Docker.
What ci:act runs, and how
scripts/act-image.shbuilds the local runner imageagore-skill/act-runner:localfrom.github/act/Dockerfile(node:24-bookworm-slim + build-essential, git, curl, archive tools — ~570 MB, native architecture, never pushed).- The CI workflow runs as
workflow_dispatchwith the event payload.github/act/ci.json: the Go job reduced to the ubuntu matrix leg, then the quality job (mise run ci), the lint job and the security job. macOS and Windows legs stay GitHub-only. - The docs job is skipped unless
ACT_INCLUDE_DOCS=1is set; with it, the docs build runs inside act too.
act reads .actrc: the ubuntu-latest runner maps to the local image,
images are never pulled (--pull=false), and containers/volumes are removed
even on failure (--rm).
What release:act-dry-run runs
The release workflow via workflow_dispatch with the payload
.github/act/release-dry-run.json (dry_run: true): GoReleaser builds
snapshot artifacts only — no GitHub release, no publish, no cosign signing,
therefore no OIDC token. Artifacts live in the container's copy of the
checkout and are listed in the job log.
Known act limitations (and why the scripts work around them)
- act's copy mode omits
.git. The Go jobs setGOFLAGS=-buildvcs=false(the checkout snapshot has no commits); the lint job alone uses--bindbecausegoreleaser checkneeds a repository. GitHub Actions checks out real history and keeps default behavior. - act's artifact server does not implement the
upload-artifact@v7protocol. The coverage upload step is guarded withif: ${{ !env.ACT }}; GitHub CI still uploads the profile. - Local runs use linux/arm64 (native) rather than GitHub's linux/amd64.
Files involved
| File | Role |
|---|---|
.actrc | Runner image mapping and act defaults |
.github/act/Dockerfile | The local runner image |
.github/act/ci.json | workflow_dispatch payload for CI |
.github/act/release-dry-run.json | Payload with dry_run: true |
scripts/act-image.sh | Builds the image |
scripts/act-ci.sh | Runs the CI jobs locally |
scripts/act-release-dry-run.sh | Runs the release workflow as a snapshot |
Related
- Every workflow, job and trigger: CI workflows reference
- Why the local-CI approach exists: Local CI with act