act
A local runner for executing GitHub Actions workflows in containers from a repository checkout.
Why consider act?
Run your GitHub Actions locally to get fast feedback and avoid cluttered commit histories.
Learn act by building
Practical setup notes, real use cases, and copy-ready examples in one focused guide.
In this guide3 sections
Testing GitHub Actions can often lead to a cluttered commit history. Developers frequently create "fix CI" or "test workflow" commits simply because they need to trigger a remote pipeline to see if their changes work. Act addresses this by providing a local task runner that reads your repository's workflow definitions and executes them directly on your machine.
By executing pipelines locally, you receive immediate validation instead of waiting for cloud resources to provision. As the project's documentation states, act is a tool that allows you to run your GitHub Actions locally, saving you from having to commit and push changes just to test your workflows.
Running Workflows Before You Commit
When you invoke the tool in your project directory, it automatically scans for standard workflow files. To execute your workflows, the tool reads the GitHub Actions defined within your .github/workflows/ directory. It then parses the YAML syntax to figure out which jobs, steps, and dependencies must be executed in order to complete the pipeline.
Because the tool leverages existing workflow configurations, you can also use it as a general-purpose local task runner. Instead of duplicating logic in a Makefile or external scripts, you can define your build, testing, and deployment routines in standard GitHub Action files and run them locally with a single command. This keeps your CI/CD configuration unified across both your local development environment and the remote repository.
How the Local Runner Simulates GitHub
To accurately replicate the remote environment, act uses containerization. Under the hood, the project relies on the Docker API to build or pull the necessary container images for your workflow execution path. It analyzes the runs-on directives in your jobs and fetches a corresponding Docker image (such as an Ubuntu-based environment) to serve as the runner. You will need to have Docker running on your system before executing your actions.
Once the container is initialized, it mounts your local repository code so the workflow steps can access it. When simulating a runner, it sets up the file system and environment variables to match what GitHub provides in its hosted environment. This includes common environment variables like GITHUB_WORKSPACE, GITHUB_REF, and GITHUB_SHA, ensuring that actions designed for the cloud function identically on your laptop. Note that because it primarily relies on Linux containers, running actions that specifically target macOS or Windows environments requires additional configuration or may not be completely simulated out-of-the-box.
Compiling the CLI from Source
The project distributes pre-compiled binaries for various operating systems, which you can download from the official releases page or install via package managers like Homebrew. However, if you want to contribute to the project or test the latest changes, you can manually compile the tool from source by cloning the repository and using Go and Make.
The official instructions for building the project are straightforward:
- Install Go tools 1.20+ - (<https://golang.org/doc/install>)- Clone this repo `git clone git@github.com:nektos/act.git`- Run unit tests with `make test`- Build and install: `make install`Once installed, you can start testing your actions locally, iterating faster, and keeping your commit history completely free of debugging noise. For complete usage details, matrix execution support, and secrets configuration, consult the official documentation at nektosact.com.
Related tools
More options with a similar category or technology profile.
diskus
Minimal, fast alternative to du -sh written in Rust using multi-threaded directory traversal.
peco
Simplistic interactive filtering tool for Unix pipelines, process lists, and file trees.
Dapr CLI
Command-line tool for managing Dapr distributed application runtime environments and sidecars.
Freeze
Generate beautiful image screenshots and SVGs of code snippets and terminal outputs.