LinuxCommandLibrary

act

Run GitHub Actions locally

TLDR

List the available jobs

$ act [[-l|--list]]
copy

Run the default event
$ act
copy

Run a specific event
$ act [event_type]
copy

Run a specific job
$ act [[-j|--job]] [job_id]
copy

Do [n]ot actually run the actions (i.e. a dry run)
$ act [[-n|--dryrun]]
copy

Show verbose logs
$ act [[-v|--verbose]]
copy

Run a specific workflow with the push event
$ act push [[-W|--workflows]] [path/to/workflow]
copy

SYNOPSIS

act [options] [--] [workflow_dispatch_input]

PARAMETERS

-h, --help
    Show help

-j, --job job
    Run specific job only

-W, --workflow file
    Run specific workflow file

-P, --platform platform=image
    Set platform(s), e.g., ubuntu-latest=nektos/act-environments-ubuntu:18.04

-s, --secret key=value
    Set secret (repeatable)

--envfile file
    Load env vars from file(s)

--event event
    Trigger specific event, e.g., push

--list
    List workflows and jobs

--dryrun
    Dry run without executing steps

--pull
    Always pull latest images

--quiet
    Reduce output verbosity

--rm
    Remove images after run

--input key=value
    Set workflow_dispatch inputs

--artifact-path path
    Path for artifacts (default ./artifacts)

DESCRIPTION

act is a zero-configuration tool for running GitHub Actions locally using Docker containers. It emulates the GitHub Actions environment, allowing developers to test, debug, and iterate on workflows without committing to a repository or waiting for remote CI/CD runs.

Key features include support for job matrices, secrets, environment variables, artifacts, and most official GitHub runners (ubuntu-latest, macos-latest, windows-latest). Simply install act, ensure Docker is running, cd into a repo with .github/workflows YAML files, and execute act. It detects and runs the triggered workflow (default: push event).

Customization is powerful: select specific jobs with -j, platforms with -P, inject secrets via -s, or simulate events like pull_request. It caches Docker images for speed, supports dry-runs, and generates summaries. Ideal for local development, reducing CI costs, and offline work.

Limitations include imperfect emulation of GitHub's hosted runners and dependency on container engines. Widely used in open-source projects for faster iteration. (187 words)

CAVEATS

Requires Docker (or compatible like podman); not all GitHub-hosted features (e.g., caches, OIDC) fully supported; large images may consume significant disk space.

INSTALLATION

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

EXAMPLE USAGE

act -j build # Run 'build' job
act -P ubuntu-latest=catthehacker/ubuntu:act-latest # Custom platform

HISTORY

Developed by Kamil Úliwakowski (nektos) in 2020 as open-source project on GitHub. Gained popularity for local CI testing; active community contributions add runner support and features. Version 0.2.x+ improves matrix and Windows emulation.

SEE ALSO

docker(1), podman(1), gh(1)

Copied to clipboard