Skip to content

act

Runs GitHub Actions workflows in local Docker containers, so a CI fix takes seconds instead of a push.

Homebrew formula

What it does

act parses .github/workflows/, builds the job graph and runs each job in a container image approximating GitHub’s runners. Secrets and variables come from --secret-file or the environment.

act -l                       # list workflows and jobs
act push -j build            # run the 'build' job of the push event
act pull_request --dryrun    # resolve the graph without executing

Caveats worth knowing

The runner images are approximations, not GitHub’s. Anything depending on the exact toolchain versions preinstalled on ubuntu-latest, on OIDC tokens, or on macos-* runners will not reproduce.

act runs workflows for real. A workflow that deploys, force-pushes, publishes a package or posts to an API will do all of those from your machine, with whatever credentials you hand it. Check what a job actually does before running it locally, and reproduce deploy workflows by running their build step directly instead.

Alternative to

AlternativeTypeTrade-off
gh workflow run on a scratch branch—Slower, but runs on GitHub’s real runners
DaggerFreemiumPipelines defined in code that run identically locally and in CI
gitlab-runner exec—The equivalent trick for GitLab CI

Install

brew install act

Links

This post is licensed under CC BY 4.0 by the author.
Last updated on