act — Run GitHub Actions Locally
act lets you run GitHub Actions workflows on your local machine. Test and debug your CI/CD pipelines without pushing to GitHub, using Docker containers to simulate the GitHub Actions runner environment.
What it is
act is a command-line tool that runs GitHub Actions workflows on your local machine. It uses Docker containers to simulate the GitHub Actions runner environment, letting you test and debug CI/CD pipelines without pushing commits to GitHub. You point act at your .github/workflows/ directory, and it executes the same steps that would run in GitHub's cloud runners.
This tool targets developers who iterate on CI/CD pipelines and want faster feedback than the push-wait-check cycle. Anyone maintaining complex GitHub Actions workflows with multiple jobs and conditional steps benefits from local testing.
How it saves time or tokens
Every push to test a CI change takes minutes of round-trip time: commit, push, wait for GitHub to schedule the runner, run the workflow, check results. act cuts this loop to seconds by running everything locally. For AI-assisted development where you generate and test workflow files iteratively, this acceleration means faster convergence on working pipelines.
How to use
- Install act via Homebrew, Chocolatey, or download the binary
- Ensure Docker is running on your machine
- Run
actin your repository root to execute the default push event workflow
Example
# Install
brew install act
# Run the default push event
act
# Run a specific event
act pull_request
# Run a specific job
act -j build
# List available workflows without running them
act -l
# Pass secrets
act -s GITHUB_TOKEN=your_token
# Use a specific image size (medium is default)
act -P ubuntu-latest=catthehacker/ubuntu:act-latest
Related on TokRepo
- DevOps tools — Explore CI/CD and deployment tools
- AI tools for automation — Browse automation workflows and tools
Common pitfalls
- act uses smaller Docker images by default that lack some tools present in GitHub's actual runners; use the full images for better compatibility
- Service containers (like PostgreSQL in CI) require Docker-in-Docker or host Docker socket mounting to work
- Some GitHub Actions features like caching and artifact upload have limited or no support in act
Frequently Asked Questions
act supports most workflow features including jobs, steps, matrix strategies, and environment variables. Some features like caching, artifact upload, and GitHub-hosted runner-specific services have limited support or require workarounds.
Yes. act uses Docker containers to simulate the GitHub Actions runner environment. Docker Desktop or Docker Engine must be installed and running on your machine.
Yes. Pass secrets via command-line flags (-s KEY=value), a .secrets file, or environment variables. act does not access your GitHub repository secrets automatically for security reasons.
act is highly accurate for standard workflow steps. Differences arise with GitHub-specific services, custom runner configurations, and some marketplace actions that depend on GitHub's infrastructure. The full Docker images improve accuracy.
While technically possible, act is designed for local development. Running act inside CI adds complexity without benefit since you are already in a CI environment. Use act for local testing before pushing.
Citations (3)
- act GitHub— Run GitHub Actions locally using Docker containers
- act README— Docker-based simulation of GitHub Actions runner environment
- GitHub Documentation— GitHub Actions workflow syntax reference
Related on TokRepo
Discussion
Related Assets
doctest — The Fastest Feature-Rich C++ Testing Framework
doctest is a single-header C++ testing framework designed for minimal compile-time overhead and maximum speed.
Chai — BDD/TDD Assertion Library for Node.js
Chai is a flexible assertion library for Node.js and browsers that supports expect, should, and assert styles.
Supertest — HTTP Assertion Library for Node.js APIs
Supertest provides a high-level API for testing HTTP servers in Node.js with fluent assertion chaining.