Skip to content
Latchkey

GitHub Actions working-directory is ignored on a uses step

working-directory sets the cwd for a run step’s shell. It is not a valid modifier for a uses step - actions decide their own working directory, usually via an input - so setting it on a uses step is silently ineffective.

What this error means

An action runs against the repo root instead of the intended subdirectory despite a working-directory set on the uses step.

github-actions
- uses: some/build-action@v1
  working-directory: packages/app   # ignored on a uses step

Common causes

working-directory only applies to run

It controls the shell cwd for run steps; uses steps do not honor it.

Action expects a path via its own input

Most actions take a path/working-directory input instead of the step-level key.

How to fix it

Pass the directory through the action input

  1. Check the action’s inputs for a path or working-directory input.
  2. Provide the subdirectory via with.
.github/workflows/ci.yml
- uses: some/build-action@v1
  with:
    working-directory: packages/app

Wrap with a run step if no input exists

  1. If the action has no path input, do the work in a run step where working-directory applies.
  2. Or cd into the directory inside a run step before invoking the tool.

How to prevent it

  • Reserve working-directory for run steps.
  • Consult an action’s inputs for path handling.

Related guides

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