Skip to content
Latchkey

GitHub Actions "working-directory ... does not exist"

A step set working-directory to a path that has not been created yet. The runner tries to chdir into it before running the command and fails because the directory is absent.

What this error means

A step with a working-directory key fails before any command runs, reporting that the directory cannot be found.

github-actions
##[error]An error occurred trying to start process '/usr/bin/bash' with working directory '/home/runner/work/app/app/frontend'. No such file or directory

Common causes

Directory not created or not checked out

The path is built by an earlier step or lives in a submodule, but checkout did not bring it in or the build step has not run yet.

Wrong relative path

working-directory is resolved relative to the workspace root; an extra or missing segment points at a nonexistent folder.

How to fix it

Verify the path exists before using it

  1. List the workspace to confirm the directory name and casing.
  2. Ensure checkout (and any generator step) runs before the step that sets working-directory.
  3. Correct the relative path and re-run.
.github/workflows/ci.yml
- uses: actions/checkout@v4
- run: ls -la
- name: Build frontend
  working-directory: frontend
  run: npm ci

How to prevent it

  • Keep working-directory paths relative to the repo root and matching the actual folder.
  • Create generated directories in an earlier step before any step cds into them.

Related guides

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