github-script icon indicating copy to clipboard operation
github-script copied to clipboard

Allow changing the directory where the script runs

Open joshmgross opened this issue 2 years ago • 1 comments

As discussed in #412, run steps support a working-directory option for changing the working directory where the command runs.

https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsworking-directory

This does not work for uses steps, requiring users to modify their scripts to include a process.chdir.

It would be nice if the action could do that with a working-directory input, avoiding the need to modify a script.

joshmgross avatar Oct 16 '23 14:10 joshmgross

There's also a suggestion in https://github.com/actions/github-script/issues/412#issuecomment-1749364551 to default to the defaults.run.working-directory.

I'm not sure if the action has access to that information and it could be a breaking change for users who have already modified their scripts to match the working-directory set for run steps.

joshmgross avatar Oct 16 '23 14:10 joshmgross