-
Say I have two packages in my repo.
I want an action to run only on the tests defined in the server/package.json. Can I achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Do you have published the two packages to GitHub Packages registry in the repository, or you just store the source code of them in the repository? Can you share your repository with us so that we can check more details about the packages and the workflow you have set up. |
Beta Was this translation helpful? Give feedback.
-
Hello @brightran , I am not using Github package registry, just storing the source code in the repository. Here is a link for the REPO https://github.com/suhan0694/mern-boilerplate. |
Beta Was this translation helpful? Give feedback.
-
Looks like, you define the tests in the scripts property of the package.json file. If you want to run the scripts in the Server package, you can try the following steps:
Hope this can help you. |
Beta Was this translation helpful? Give feedback.
@suhan0694 ,
Looks like, you define the tests in the scripts property of the package.json file. If you want to run the scripts in the Server package, you can try the following steps:
Use checkout action to check out the repository to the workspace (github.workspace or GITHUB_WORKSPACE) of the workflow.
Switch the working-directory of the shell to the directory where the package.json file of Server is located, for example execute cd server in your case.
Execute the npm-run-script command to run the scripts in the package.json file.
Hope this can help you.