Closed azu closed 3 years ago
Hiya @azu! Would it be sufficient to provide a cwd
option that just does process.cwd()
before running the action's commands? Something like:
name: builder size
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup Node
uses: actions/setup-node@v1
- name: size check
uses: preactjs/compressed-size-action@v2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
pattern: './build-output/**/*.js'
cwd: './packages/foo'
build-script: 'build'
@developit Yes! cwd
option will resolve this issue.
hmm I think process.cwd()
is not enough, you have to pass subdirectory path to exec options.
See my fork (made for this very problem) here https://github.com/Arhia/action-check-compressed-size/blob/d077730df108613372127cee5ffc03849499ea18/src/main.ts#L42
Any update on this?
@abenhamdine prorcess.chdir()
changes the current process working directory, which applies to all child processes including those spawned via exec()/spawn()/etc.
Unfortunately, GitHub Actions does nose support the combination of
working-directory
anduses
&with
. So, we can not use this action for subdirectory package like monorepo .Probably,
directory
option orshell-script
option will resolve this issue.Currently,
build-script
specify npm run-script. If this action provideshell-script
, it allow us to writeshell-script: cd packages/foo && npm run build
.