Test GitHub Actions Locally with act

VerifiedCaution

Installation and usage guide for act to run GitHub Actions workflows locally in Docker, covering secrets, inputs, matrices and runner images.

Sby Skills Guide Bot
DevOpsIntermediate
11/16/2026
Claude CodeCursorWindsurfCopilotCodex
#github-actions#ci#docker#local-testing#workflow-debugging

Recommended for

Automated summary

Runs GitHub Actions workflows locally in Docker containers with act so CI can be tested and debugged without pushing commits.

Strengths

  • Covers installation, runner image selection, secrets, variables, and debugging options.
  • Provides concrete commands for listing jobs, targeting an event or job, and filtering matrix entries.
  • Explains act-specific workarounds such as ACT=true and event files for adapting workflows.
  • Highlights non-interactive pitfalls and recommends a project .actrc to avoid blocking prompts.

Limitations

  • Requires Docker Engine and does not support podman.
  • The medium runner image lacks many GitHub runner tools, while the full image is very large.
  • The local environment is not an exact match for GitHub-hosted runners, and job-level conditions often need adjustments.
When to use it

Use it to quickly reproduce a failing CI job or validate a workflow edit before pushing.

When not to use it

Avoid it when Docker is unavailable or when you need exact parity with GitHub-hosted runners.

Security analysis

Caution
Quality score86/100

The skill is documentation-style guidance for a real, legitimate tool (nektos/act) and contains no hidden payloads, curl|sh pipelines, or secret-exfiltration behavior. However, its core function is to execute arbitrary workflow-supplied code, it documents a host-execution mode (`-self-hosted`), and it handles credential files and environment-sourced secrets, so it warrants a caution rating rather than safe.

Findings
  • •Running GitHub Actions workflows locally executes arbitrary shell code from repository workflow files inside Docker containers, so any workflow in a cloned/untrusted repo runs code on the user's machine (with container-level access to the workspace and any mounted paths).
  • •The guideline `-P ubuntu-latest=-self-hosted` explicitly causes jobs to run directly on the host rather than in a container; combined with untrusted workflows this is effectively host-level code execution, and it is presented with only a brief caveat.
  • •The skill directs users to feed credential material into runs (`--secret-file .secrets`, `-s NPM_TOKEN` read from the shell environment, `--var-file`, `--env-file`) and to write these into project files; while it advises throwaway values and .gitignore, a user following it casually could expose real tokens to containerized code or commit them.
  • •It relies on pulling third-party Docker images (catthehacker/ubuntu) and GitHub Actions at runtime from the network, an inherent supply-chain dependency not pinned by digest.
  • •No obfuscation, exfiltration, or prompt-injection attempts were found; all commands are transparent and documented.
  • •Uses Docker and pulls third-party runner images by default, creating a supply-chain and host-resource exposure surface.
  • •Handles secrets via --secret-file, environment variables, and GITHUB_TOKEN; guidance recommends throwaway values but users could pass real credentials.
  • •Mentions -P ubuntu-latest=-self-hosted, which runs workflow jobs directly on the host; it is warned about but remains a high-impact option.
  • •Includes package installation commands from multiple package managers and GitHub releases; checksum verification is suggested but optional.
How this analysis is made

Examples

Debug a failing CI job
My GitHub Actions test job fails on CI and I can't see why. Create a project .actrc using catthehacker/ubuntu:act-latest and run only the test job locally with my .secrets file and verbose logs.
Run a pull_request workflow with inputs
Run the pull_request workflow locally with act, pass the target input through an event payload, and load environment values from my .env file.
Validate workflows before pushing
Before I push, use act to dry-run and validate .github/workflows/ci.yml, then show me the job graph and any schema errors.

name: act description: >- Runs GitHub Actions workflows on your own machine in Docker containers with act, so CI can be tested without pushing. Use when a user asks to test GitHub Actions workflows locally, debug a failing CI pipeline, pass secrets or inputs to a local run, or run workflows offline. license: Apache-2.0 compatibility: 'Docker Engine required (podman is not supported); Linux, macOS, Windows' metadata: author: terminal-skills version: "1.2.0" category: development tags: "act, github-actions, ci, local, docker" repository: https://github.com/nektos/act

Act

Overview

act reads .github/workflows/, pulls or builds the images the jobs need, and runs each job in a Docker container with the environment variables and filesystem layout GitHub uses. It is a fast feedback loop for workflow edits and a way to use workflows as a local task runner. Current release is v0.2.89 (June 2026). Docs: https://nektosact.com.

Instructions

Step 1: Install

Use a package manager: brew install act (macOS, Linux), winget install nektos.act or choco install act-cli (Windows), pacman -Syu act (Arch), nix-shell -p act, or the GitHub CLI extension gh extension install https://github.com/nektos/gh-act. Alternatively download the archive for your platform from the GitHub releases page and verify it against checksums.txt from the same release (sha256sum -c) before unpacking. Docker Engine must be running.

Step 2: Pick runner images

The first run without configuration asks you to choose an image size and saves the choice to ~/.config/act/actrc. Skip the prompt, which also hangs in non-interactive shells, by putting the mapping in a project .actrc (one flag per line):

-P ubuntu-latest=catthehacker/ubuntu:act-latest
--env-file .env
--action-offline-mode

act-latest is the "medium" image; it lacks many tools of the real GitHub runner. catthehacker/ubuntu:full-latest is closer but is about 17 GB to download (the prompt itself warns of 75 GB of free disk). On Apple Silicon add --container-architecture linux/amd64.

Step 3: Run

act -l                              # list jobs and their events
act                                 # run the "on: push" workflows
act pull_request                    # run a specific event
act -j test                         # one job (its `needs` jobs run too)
act -W .github/workflows/ci.yml     # one workflow file
act workflow_dispatch --input target=production
act push --matrix node:22          # only matrix entries that include node 22
act -e event.json                   # custom event payload

Step 4: Secrets, variables, local-only behavior

act --secret-file .secrets          # KEY=value lines; default file is .secrets
act -s NPM_TOKEN                    # take the value from your shell environment
act --var-file .vars                # values for ${{ vars.NAME }}
act --env-file .env                 # plain environment variables

act sets ACT=true, so a step can skip itself locally with if: ${{ !env.ACT }}. Job-level if: cannot see env; use an event file such as {"act": true} with act -e event.json and test !github.event.act.

Step 5: Debug

act -n          # dry run: validates and prints the plan without creating containers
act --validate  # check workflow schema
act -g          # draw the job graph
act -v          # verbose logs
act -r          # keep the container after success to inspect state between runs
act --artifact-server-path .artifacts   # enable upload-artifact/download-artifact

Examples

Example 1: Reproduce a failing CI job before pushing

User request: "My test job fails on GitHub but I cannot see why. Run it locally."

printf -- '-P ubuntu-latest=catthehacker/ubuntu:act-latest\n' > .actrc
act -j test --secret-file .secrets -v

Result: act pulls the image on the first run, then streams each step as [CI/test] | ..., ending with Job failed and the failing step's output, so the fix can be tried and rerun in seconds.

Example 2: Run a deploy workflow with inputs and without side effects

User request: "Dry-run the deploy workflow for production but do not post to Slack"

Workflow step: - if: ${{ !env.ACT }} on the Slack notification.

printf 'AWS_REGION=eu-west-1\n' > .vars
printf 'NPM_TOKEN=npm_localdummy\n' > .secrets
act workflow_dispatch --input target=production

Result: The job log shows target=production and region=eu-west-1, the Slack step is skipped, and the run ends with Job succeeded.

Guidelines

  • Add .secrets, .vars and .env to .gitignore; use throwaway values locally, never production credentials.
  • Not everything works: OIDC tokens, GitHub-hosted service features, systemd, many preinstalled tools and cross-run artifact downloads are missing or differ. A green local run is not proof for GitHub.
  • Podman and other container engines are not supported; --pull is on by default, so images are fetched each run; add --pull=false or --action-offline-mode once images are cached.
  • First pulls are large (the medium image is about 500 MB, the large one about 17 GB, the micro one under 200 MB but incompatible with many actions).
  • Use -P ubuntu-latest=-self-hosted only when you accept jobs running directly on your host.
  • Actions fetched by act may need a token to avoid GitHub rate limits; pass it with -s GITHUB_TOKEN.
  • Delete leftover containers with docker rm after -r runs.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/test-github-actions-locally-with-act-mwirmduu/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/test-github-actions-locally-with-act-mwirmduu' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/test-github-actions-locally-with-act-mwirmduu/download' --output '.skill-downloads/test-github-actions-locally-with-act-mwirmduu/SKILL.md.part' && mv '.skill-downloads/test-github-actions-locally-with-act-mwirmduu/SKILL.md.part' '.skill-downloads/test-github-actions-locally-with-act-mwirmduu/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Environment declared by the author: Docker Engine required (podman is not supported); Linux, macOS, Windows

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/test-github-actions-locally-with-act-mwirmduu/SKILL.md' && test -s '.skill-downloads/test-github-actions-locally-with-act-mwirmduu/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/act' && cp -R '.skill-downloads/test-github-actions-locally-with-act-mwirmduu' '.claude/skills/act'

Cursor
test -f '.skill-downloads/test-github-actions-locally-with-act-mwirmduu/SKILL.md' && test -s '.skill-downloads/test-github-actions-locally-with-act-mwirmduu/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/act' && cp -R '.skill-downloads/test-github-actions-locally-with-act-mwirmduu' '.cursor/skills/act'

Codex
test -f '.skill-downloads/test-github-actions-locally-with-act-mwirmduu/SKILL.md' && test -s '.skill-downloads/test-github-actions-locally-with-act-mwirmduu/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/act' && cp -R '.skill-downloads/test-github-actions-locally-with-act-mwirmduu' '.agents/skills/act'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/test-github-actions-locally-with-act-mwirmduu'

openskills read 'test-github-actions-locally-with-act-mwirmduu'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/test-github-actions-locally-with-act-mwirmduu/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills