How to run GitHub Actions locally
Last reviewed: 23 November 2026, against SecureCI CLI 1.4.0
To run GitHub Actions locally, install the SecureCI CLI (secureci) and run secureci run .github/workflows/ci.yml in your repository. Each job runs in its own container on Docker, Podman or containerd. You test the workflow on your machine, without a commit and a push for every attempt. Then run secureci validate and secureci pin --check to catch security problems and unpinned actions before you push.
Short answer:
- Install:
npm install -g @secureci/cli(Node.js 20+), or the standalone binary. - Preview:
secureci run .github/workflows/ci.yml --dry-runlists the jobs and steps, and runs nothing. - Run:
secureci run .github/workflows/ci.ymlruns each job in a container. - Check:
secureci validateandsecureci pin --checkbefore you push.
Why test workflows before pushing
The usual way to debug a workflow is slow to repeat. You edit the YAML, commit, push, wait for a runner and read the log. If a step fails, you start again. Each attempt adds a commit to the branch history.
A local run shortens that loop. You run the same workflow file on your own machine, read the output and fix it before anyone else sees it.
A workflow that runs is not always a workflow that is safe to merge. It can still expand untrusted input into a shell script. It can ask for more token permissions than it needs. It can use an action tag that someone can later move to different code. So this guide covers both steps: run the workflow, then check it.
Run a workflow with the SecureCI CLI
1. Install the CLI
The SecureCI CLI is free and open source (MIT). Install it from npm, which needs Node.js 20 or later:
npm install -g @secureci/cli
# or run it without installing:
npx @secureci/cli --help
If you would rather not use Node.js, there is a standalone binary for Linux, macOS and Windows. On Linux or macOS, the install script checks the binary against the release’s SHA256SUMS and installs it to ~/.local/bin without sudo:
curl -fsSL https://secure-ci.dev/install.sh | sh
You can read the script before you run it, or download and verify a binary yourself. The steps are in the install section of the docs.
2. Preview with a dry run
Start with --dry-run. It reads the workflow, works out the jobs and steps, and prints them. Nothing is executed and no container starts. Here is a small workflow:
# .github/workflows/ci.yml
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm test
This is the real output of a dry run with CLI 1.4.0:
$ secureci run .github/workflows/ci.yml --dry-run
[INFO] Workflow: CI
[INFO] Trigger: {"push":{"branches":["main"]},"pull_request":null}
→ Job: test (test)
[INFO] Runs on: ubuntu-latest
[INFO] Step 1: uses: actions/checkout@v4
[INFO] Step 2: uses: actions/setup-node@v4
[INFO] Step 3: run: npm ci
[INFO] Step 4: run: npm test
✓ Dry run completed successfully
A dry run also checks every if: expression first. Syntax errors, unknown functions such as a typo like sucess(), and contexts used where GitHub does not allow them all fail up front, as they would on GitHub.
3. Run it for real
Drop --dry-run to execute the workflow:
secureci run .github/workflows/ci.yml
Each job, and each matrix combination, gets one container. The container starts when the job begins and is removed when it ends, even if a step fails or you press Ctrl-C. Every run: step and JavaScript action in the job runs inside it, so files and tools from earlier steps are still there. Your current directory is mounted into the container as the workspace.
Jobs run in needs: order. Independent jobs and matrix combinations run in parallel. The runs-on label picks a runner-like image: ubuntu-latest maps to catthehacker/ubuntu:act-latest, the image nektos/act uses. These images are about 2 GB unpacked and are pulled on first use.
4. Choose a job, event, matrix and inputs
You rarely want the whole workflow every time. These flags narrow the run or give it the values it expects:
# One job
secureci run .github/workflows/ci.yml --job build
# Only some matrix combinations
secureci run .github/workflows/test.yml --job test --matrix node:20 --matrix os:ubuntu-latest
# Simulate a pull_request event with your own payload
secureci run .github/workflows/ci.yml --event-name pull_request --event-path event.json
# Inputs, repository variables and secrets
secureci run wf.yml --input key=value --var ENVIRONMENT=staging --secret TOKEN
# The same values from .env-style files
secureci run wf.yml --env-file .env --secret-file .secrets --input-file inputs.env --var-file vars.env
A bare --secret TOKEN reads $TOKEN from your shell. That keeps the value out of the process list and your shell history. Every secret value is masked as *** in the output. Values derived from a secret are not, so see how GitHub Actions secrets leak before you print one.
Without --event-name, the event is workflow_dispatch if the workflow declares it, otherwise the first trigger. See events and the github context for how the rest of the github context is filled in.
Container runtimes: Docker, Podman and containerd
Docker is the default. Podman and containerd are built in, so you do not need a Docker-compatible socket. Pick one with --container-runtime:
secureci run .github/workflows/ci.yml --container-runtime podman
secureci run .github/workflows/ci.yml --container-runtime containerd # through nerdctl
# Make Podman your default
secureci config set container-runtime podman
containerd is driven through nerdctl, its Docker-compatible command-line front end. You can also cap memory, cut off the network or time out long steps:
secureci run .github/workflows/ci.yml \
--container-runtime podman --container-memory 512m --no-network
If the runtime is missing or not running, the CLI stops before any step runs. It never falls back to your machine on its own. This is what CLI 1.4.0 printed on a machine where the Docker daemon was not running:
[ERROR] No container runtime available: "docker" is not installed or not running. Start it, pick another with --container-runtime, or run steps directly on this machine, with your user's privileges, with --container-runtime host.
Host mode, --container-runtime host, is an explicit opt-in. It runs steps and third-party actions directly on your machine, with your user’s privileges, so use it only for workflows you trust.
Check the workflow before you push
A green local run tells you the workflow works. It does not tell you the workflow is safe. Two more commands cover that, and neither runs a step.
secureci validate checks syntax and expressions. It also flags template injection, where untrusted ${{ }} input is expanded into a run: script. It reports missing or excessive GITHUB_TOKEN permissions, and pull_request_target or workflow_run jobs that check out and run untrusted code. Actions with known advisories in the GitHub Advisory Database are reported too. For a walk-through of its output, see how to lint GitHub Actions workflows.
If your team has a pipeline standard, write it as a contract and check against it. A contract can require or forbid actions, fix their order, set minimum versions, demand SHA pinning and limit which owners are allowed:
secureci validate .github/workflows/ci.yml
secureci validate .github/workflows/deploy.yml --contract contracts/standard.yml
secureci pin --check changes nothing. It exits non-zero if any action is still on a tag or branch instead of a full commit SHA. To fix that, secureci pin rewrites each tag in place and keeps the tag as a comment, so Dependabot and Renovate can still offer updates:
- uses: actions/checkout@v4
# becomes
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
Put together, a pre-push routine looks like this:
secureci run .github/workflows/ci.yml --dry-run # what would run
secureci run .github/workflows/ci.yml # run it in a container
secureci validate .github/workflows/ci.yml # security and syntax checks
secureci pin --check # every action pinned to a SHA
For how these checks compare with generic linters and scanners, see SecureCI vs actionlint and zizmor. For the full rules, see pinning in the docs.
Limits of local runs
The CLI aims for high runner fidelity, but it is not the GitHub runner. Know these limits before you trust a green local run. The limitations section of the docs has the full list.
- Linux containers only. A
windows-*ormacos-*job runs in a Linux image, with a warning. - Your working copy is used as it is.
actions/checkoutof the current repository does not clone, so uncommitted changes are visible to the job. - Parallel jobs share your working copy. Jobs that write the same files can collide. Pass
--isolate-workspaceto give each job its own copy, or--parallel 1to run them one at a time. - Artifacts and cache stay local. They are stored under
~/.secureci/, and nothing is uploaded to or downloaded from GitHub. - Some features are not emulated. Deployment
environment:protection rules and environment-scoped secrets are not, so pass those values with--secretor--var. OIDC tokens forid-token: writeare not emulated either.
SecureCI vs nektos/act
The SecureCI CLI uses the same catthehacker/ubuntu runner images as nektos/act, and most act commands map directly:
| You want to… | nektos/act | SecureCI CLI |
|---|---|---|
| Simulate without running | act -n | secureci run … --dry-run |
| Run one job | act -j build | secureci run … --job build |
| Pass a secret | act -s TOKEN | secureci run … --secret TOKEN |
| Use Podman | A Docker-compatible DOCKER_HOST socket | secureci run … --container-runtime podman |
The difference is what comes after the run. act does not check workflows against your team’s standards, enforce SHA pinning or keep a lockfile that fails when an action tag moves. The SecureCI CLI does all three. If you already use act, you can keep it and add secureci validate to the same pre-push step. The full comparison is in SecureCI vs nektos/act.
Try the SecureCI CLI
Free and open source (MIT). Needs Node.js 20+ (or a standalone binary) and, to run workflows, Docker, Podman or containerd.
npm install -g @secureci/cli
secureci run .github/workflows/ci.yml --dry-run
secureci validate .github/workflows/ci.yml
Running GitHub Actions across many repositories? Get early access to the GitHub App → or get a free assessment.
FAQ
Can I run GitHub Actions locally?
Yes. Install the free SecureCI CLI and run secureci run .github/workflows/ci.yml. Each job runs in its own Linux container on Docker, Podman or containerd. It is not the GitHub runner, so check the documented limitations before you trust a green local run.
How do I test a workflow without pushing?
Run secureci run with --dry-run to see the jobs and steps that would run, then run it for real in a container. secureci validate checks syntax, expressions and security issues without running any step, and secureci pin --check fails if an action is not pinned to a commit SHA.
Does act support secrets?
Yes. nektos/act takes secrets with -s and --secret-file. The SecureCI CLI has the same pair, --secret and --secret-file, masks every secret value in its output, and in container mode never puts secret values on the container client’s command line.
Is the SecureCI CLI free?
Yes. The SecureCI CLI is free and open source under the MIT license, for public and private repositories. An org-wide SecureCI platform for platform and security teams is in development, and pilot organisations can ask us for an assessment.