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.
Staging sûr pour cet actif
Cet actif est d'abord staged. Le prompt copié demande à l'agent d'inspecter les fichiers staged avant d'activer scripts, config MCP ou config globale.
npx -y tokrepo@latest install 006a587e-371c-11f1-9bc6-00163e2b0d79 --target codexStage les fichiers d'abord; l'activation exige la revue du README et du plan staged.
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
Questions fréquentes
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.
Sources citées (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
En lien sur TokRepo
Fil de discussion
Actifs similaires
actionlint — Lint GitHub Actions Locally
actionlint catches syntax mistakes and expression/type errors in GitHub Actions workflows before CI runs, so broken YAML never blocks your team.
LocalAI — Run Any AI Model Locally, No GPU
LocalAI is an open-source AI engine running LLMs, vision, voice, and image models locally. 44.6K+ GitHub stars. OpenAI/Anthropic-compatible API, 35+ backends, MCP, agents. MIT licensed.
Actions Runner Controller — Self-Hosted GitHub Actions on Kubernetes
Autoscale self-hosted GitHub Actions runners on Kubernetes, matching runner capacity to workflow demand with scale-to-zero support and ephemeral runner pods.
Minikube — Run Kubernetes Locally on Any OS
Runs a single-node Kubernetes cluster on your laptop so you can try Kubernetes features without a cloud bill.