How to Run GitHub Actions Locally with act: Fast Debugging & CI/CD

Learn how to use act to run and debug GitHub Actions workflows locally for faster CI/CD iteration. This guide covers installation, usage, limitations, and how tools like Apidog can further streamline your API development workflow.

Maurice Odida

Maurice Odida

31 January 2026

How to Run GitHub Actions Locally with act: Fast Debugging & CI/CD

Testing and iterating on GitHub Actions workflows can be slow. Every change usually means a commit, a push, and waiting for GitHub runners—frustrating for API developers and backend engineers who need to debug or rapidly prototype their CI/CD pipelines. What if you could run and debug your workflows locally, getting instant feedback before pushing to GitHub?

This guide explains how to use act, a powerful open-source CLI tool that runs GitHub Actions locally using Docker. You'll learn how act works, how to install it, practical usage tips, limitations, and how tools like Apidog can enhance your workflow.


Why Test GitHub Actions Locally?

Local testing with act offers API and backend teams the following advantages:

💡 Looking for an API platform that generates beautiful API documentation and boosts team productivity? Try Apidog. It streamlines API testing and collaboration for developers, providing an all-in-one solution at a cost lower than Postman. Image

button

How Does act Simulate GitHub Actions?

act leverages Docker to emulate the GitHub Actions runner environment, running each workflow job in an isolated container. Here’s how it works:

  1. Workflow Discovery: Scans .github/workflows/ for YAML files in your repository.
  2. Event Simulation: By default, simulates a push event, but can trigger others (e.g., pull_request, workflow_dispatch).
  3. Dependency Resolution: Understands job dependencies (needs:) to run jobs in order.
  4. Docker Image Selection: Maps the runs-on: field to Docker images representing the runner environment.
  5. Container Execution: Runs each job step in a container, injecting environment variables, mounting your repo, and streaming logs to your terminal.

Example:
If your workflow runs on ubuntu-latest, act will pull a compatible Ubuntu Docker image, mount your repo at /github/workspace, and execute steps as they would run on GitHub.


Prerequisite: Install Docker

act depends on Docker. Ensure Docker is installed and running:

Verify Docker with:

docker run hello-world

How to Install act

Choose the method that best fits your OS and workflow:

1. Homebrew (macOS/Linux)

brew install act

For the cutting-edge version:

brew install act --HEAD

2. GitHub CLI Extension

gh extension install nektos/gh-act
gh act            # Usage

3. Windows Package Managers

4. Linux Script Installer

curl -s https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash

Review the script for security before running.

5. Other Package Managers

Check the official docs for Arch, Fedora COPR, MacPorts, Nix, etc.

Verify Installation:

act --version
# or
gh act --version

Choosing a Runner Image in act

The first time you run act, you'll be asked to pick a default Docker image for the runner:

Tip: Start with Medium for most workflows. Upgrade to Large only if you hit missing tool errors.

act stores your choice in ~/.actrc. You can change it anytime.


Core Usage: Running Workflows Locally

Navigate to your project root (with the .github folder) and try:

1. Run Default Push Event

act
# or
gh act

2. List All Workflows and Jobs

act -l

Example output:

Stage  Job ID    Job name   Workflow name  Workflow file   Events
0      build     Build      CI Pipeline    ci.yaml         push
1      test      Test       CI Pipeline    ci.yaml         push
1      lint      Lint       Code Quality   codeql.yaml     push,pull_request

3. Run a Specific Job Only

act -j build

4. Simulate Different Events

act pull_request
act workflow_dispatch
act schedule
act release -e event.json  # with a payload file

5. Pass Inputs to workflow_dispatch

act workflow_dispatch --input environment=staging

6. Manage Secrets and Environment Variables

Always add secrets files to .gitignore.


Customizing Runner Environments

1. Specify Custom Images per Platform

If you need a different Docker image for a specific runs-on:, use -P:

act -P ubuntu-22.04=ghcr.io/catthehacker/ubuntu:full-22.04
act -P ubuntu-latest=node:18-bullseye

2. Use Local Images & Offline Mode

act --pull=false

Prevents automatic pulling of images.

3. Native Execution (macOS/Windows)

To run jobs directly on your host OS (not in Docker):

act -P macos-latest=-self-hosted
act -P windows-latest=-self-hosted

Caution: This bypasses Docker isolation. Use carefully.


act Limitations and Best Practices

While act is excellent for rapid iteration, know its limits:

Best Practice: Use act for development, syntax, and logic checks. For production and deployment workflows, always validate on GitHub itself to avoid surprises.


Power Up Your API Workflows with Apidog

Efficient CI/CD is only part of high-quality API development. Tools like Apidog help API-focused teams:

Apidog integrates smoothly into local and CI/CD pipelines, streamlining workflows for backend and QA engineers.

Image

button

Conclusion

Running GitHub Actions locally with act transforms your workflow:

Combine act with professional API tools like Apidog for even smoother API lifecycle management.

Explore more

What API keys or subscriptions do I need for OpenClaw (Moltbot/Clawdbot)?

What API keys or subscriptions do I need for OpenClaw (Moltbot/Clawdbot)?

A practical, architecture-first guide to OpenClaw credentials: which API keys you actually need, how to map providers to features, cost/security tradeoffs, and how to validate your OpenClaw integrations with Apidog.

12 February 2026

What Do You Need to Run OpenClaw (Moltbot/Clawdbot)?

What Do You Need to Run OpenClaw (Moltbot/Clawdbot)?

Do you really need a Mac Mini for OpenClaw? Usually, no. This guide breaks down OpenClaw architecture, hardware tradeoffs, deployment patterns, and practical API workflows so you can choose the right setup for local, cloud, or hybrid runs.

12 February 2026

What AI models does OpenClaw (Moltbot/Clawdbot) support?

What AI models does OpenClaw (Moltbot/Clawdbot) support?

A technical breakdown of OpenClaw’s model support across local and hosted providers, including routing, tool-calling behavior, heartbeat gating, sandboxing, and how to test your OpenClaw integrations with Apidog.

12 February 2026

Practice API Design-first in Apidog

Discover an easier way to build and use APIs