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 stepCommon 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
- Check the action’s inputs for a path or working-directory input.
- Provide the subdirectory via with.
.github/workflows/ci.yml
- uses: some/build-action@v1
with:
working-directory: packages/appWrap with a run step if no input exists
- If the action has no path input, do the work in a run step where working-directory applies.
- 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
GitHub Actions defaults.run.shell is ignored inside a composite actionFix a composite action where each run step still needs an explicit shell because defaults.run.shell does not…
GitHub Actions Composite Action Ignores working-directoryFix GitHub Actions composite action run steps ignoring working-directory - each composite step needs its own…
GitHub Actions "working-directory ... no such file or directory"Fix GitHub Actions working-directory errors - the path does not exist yet, is relative to the wrong base, or…