Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Ground Controller Lvl 1
Message 1 of 2

Setting the workdir for actions using uses

Have been totally stumped by this one. I'm aware of the `working-directory` option for steps that use `run` but there does not seem to be anything comparable when using `uses`.

 

I've tried a number of approaches:

 

- `working-directory` errors

- `with.workdir` is ignored (I can see the docker run statement still has the hardcoded `--workdir` for the full workspace.

- `run: cd my-subdir` does not persist to later steps

 

As-is, it's seemingly impossible to use an action like the `actions-hub/gcloud` action when the working directory is important, such as `gcloud app deploy` which requires the application to be located in the current directory.

 

I've been using Cloudbuild for a similar process for some time, and they have a `dir` option available on each step which can scope all the work that happens there. Unless I'm missing something, a similar option might be necessary here (e.g., baked in logic that concatenates a `dir` on uses with the default `workdir` being set).

1 Reply
GitHub Partner
Message 2 of 2

Re: Setting the workdir for actions using uses

The keyword 'Working-directory' only works for the script steps, not for action steps.
An action is reusable/isolated code, therefore there is no working directory for a step that uses an action. You probably have to give the action an argument and pass a path.