You want every 'run:' step in a single job to execute with working directory './services/api' without setting 'working-directory' on each step. Where do you configure this?
Select an answer to reveal the explanation.
Short Explanation and Infographic
defaults.run can live at workflow or job level. Put working-directory under the job's defaults.run so only that job's shell steps inherit it — action steps ignore it.
Full explanation below image
Full Explanation
The defaults block lets you set shell and working-directory for run: steps. It is valid at workflow level (applies to all jobs) and at job level (applies only to that job). For a monorepo where only the API job should run under services/api, set defaults.run.working-directory at the job level. Workflow-level defaults would affect every job, which is broader than the requirement. An env variable named WORKING_DIRECTORY is just an environment variable; it does not change the shell's cwd unless a step explicitly cds using it. runs-on only selects the runner label or image; it has no working-directory field. Note that defaults.run applies only to run: steps, not to uses: actions, which manage their own directories.