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.
Error: fatal: could not read Username for 'https://github.com': terminal prompts disabled
Error: The process '/usr/bin/git' failed with exit code 128Common 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.
act -s GITHUB_TOKEN="$(gh auth token)" -j buildRun act from the repository root
- Invoke act from the top of the working tree so the bind includes
.git. - Avoid overriding the working directory bind unless you know the path.
- Confirm
git statusworks locally before running act.
cd /path/to/repo
act -j buildHow 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.