Skip to content
Latchkey

act "actions/checkout" fails locally running Actions with act

act binds your local repository into the container, so actions/checkout does not need to clone from GitHub. Failures usually come from a missing token when the action tries a network fetch, or from the bind path not matching what checkout expects.

What this error means

The checkout step errors with an auth failure, "could not read Username", or "fatal: not a git repository" while running the workflow under act.

act
Error: fatal: could not read Username for 'https://github.com': terminal prompts disabled
Error: The process '/usr/bin/git' failed with exit code 128

Common causes

No GITHUB_TOKEN for the network fetch

When checkout falls back to fetching from GitHub, it needs a token; without -s GITHUB_TOKEN=... the git request is unauthenticated and fails.

The repository is not bound as git expects

If act cannot bind the local .git directory (or you run outside the repo root), checkout sees no git repository.

How to fix it

Provide a GITHUB_TOKEN

Pass a personal access token so any network fetch by checkout can authenticate.

Terminal
act -s GITHUB_TOKEN="$(gh auth token)" -j build

Run act from the repository root

  1. Invoke act from the top of the working tree so the bind includes .git.
  2. Avoid overriding the working directory bind unless you know the path.
  3. Confirm git status works locally before running act.
Terminal
cd /path/to/repo
act -j build

How to prevent it

  • Pass a GITHUB_TOKEN when steps may reach the GitHub API or clone.
  • Run act from the repository root so the bind is complete.
  • Remember act reuses your local tree instead of a fresh clone.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →