DEV Community

Alex Spinov
Alex Spinov

Posted on

You Can Run GitHub Actions Locally With act — No More Commit-Push-Wait Cycles

Stop Pushing to Test Your Workflows

act runs GitHub Actions locally using Docker. Test your CI/CD pipeline in seconds instead of pushing and waiting.

Install

# macOS
brew install act

# Linux
curl -s https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
Enter fullscreen mode Exit fullscreen mode

Run Workflows

# Run default workflow
act

# Run specific event
act push
act pull_request

# Run specific job
act -j test
act -j build

# List all workflows
act -l
Enter fullscreen mode Exit fullscreen mode

How It Works

act reads your .github/workflows/ YAML files and runs them in Docker containers. Same environment as GitHub, but on your machine.

Pass Secrets

# From file
act --secret-file .secrets

# Inline
act -s MY_TOKEN=abc123

# From environment
act -s MY_TOKEN
Enter fullscreen mode Exit fullscreen mode

Use Cases

  1. Debug failing CI — no more commit-push-wait-check cycles
  2. Test new workflows before pushing
  3. Run workflows offline
  4. Speed up development — local runs are faster than cloud
  5. Test matrix builds locally

Limitations

  • Some GitHub-hosted runners have tools not in Docker images
  • Services (like postgres) need extra Docker setup
  • GitHub-specific features (OIDC, caching) may not work

But for 90% of workflows, it just works.


More


More from me: 10 Dev Tools I Use Daily | 77 Scrapers on a Schedule | 150+ Free APIs

Top comments (0)