You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was about to set-up a worklfow using your action for a different repo and noticed that it was unable to find package.json, even though i specified the working directory correctly at the workflow level.
When comparing this to the way the official setup-node action resolves its files, we can see that they specifically prefix this with process.cwd to include the specified working directory.
I've forked your action now and started to work a little bit on the issue. Turns out that working-directory parameter is not passed to a action from a workflow. Therefore i have introduced an additional path parameter to the actions inputs and am passing it to every exec call as cwd option. This seems to work quite well.
Sorry and thank you for your patience. Interesting issue. A workaround for that issue would be to run the action after you performed a directory change, e.g. with cd. I believe the action always runs in the context of the current job. The file path should therefore always be related to the current state of the job. At least this is how we can use it over here https://github.com/kordis-leitstelle/kordis/blob/main/.github/workflows/nx-migration-checker.yml. If you open a PR, it will run a integration test by creating running the acton once, so you can open a PR if you like.
Hey Timon,
really appreciate your project, nice work!
I was about to set-up a worklfow using your action for a different repo and noticed that it was unable to find package.json, even though i specified the working directory correctly at the workflow level.
I suspect the below line to be the caulprit:
nx-migration-gh-action/src/nx-version.ts
Line 5 in 5ecb076
When comparing this to the way the official setup-node action resolves its files, we can see that they specifically prefix this with
process.cwd
to include the specified working directory.Example from github/setup-node
I can open up a PR if you want, but i am not sure on how i would go about testing the action locally for correctness.
The text was updated successfully, but these errors were encountered: