github-action
github-action copied to clipboard
No such file or directory 'package.json'
I have the following steps in my github action .yml file:
- uses: actions/checkout@v2
- name: Enter serverless dir and deploy
uses: serverless/[email protected]
with:
args: -c "cd ./src/serverless && serverless plugin install --name serverless-plugin-tracing && serverless deploy"
entrypoint: /bin/sh
But I'm getting an error, despite the fact that I do have a package.json file in my src/serverless folder:
npm ERR! enoent ENOENT: no such file or directory, open '/github/home/.npm/_cacache/tmp/jrJNSF/package.json'
Does anyone know of a workaround/solution for this?
The indent is wrong in you example, the entrypoint should be in the same level as args:
- uses: actions/checkout@v2
- name: Enter serverless dir and deploy
uses: serverless/[email protected]
with:
args: -c "cd ./src/serverless && serverless plugin install --name serverless-plugin-tracing && serverless deploy"
entrypoint: /bin/sh
Sorry that was just a copy pasting mistake, the indentation of the entrypoint line is the same as args in my actual repo. I've updated my original comment to reflect this
Created #90 to allow changing working directory and installing packages, should provide a cleaner way to accomplish this.