Github action searches for package.json in the project, but in a folder with the same name as the project ('/home/runner/work/javascript-coding-challenges/javascript-coding-challenges/package.json'
). I don't have package.json
there.
My jest.yaml
name: Run Jest tests
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm install
- name: Run tests
uses: stefanoeb/jest-action@1.0.3
with:
jestArgs: passWithNoTests
Error:
npm WARN saveError ENOENT: no such file or directory, open '/home/runner/work/javascript-coding-challenges/javascript-coding-challenges/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/runner/work/javascript-coding-challenges/javascript-coding-challenges/package.json'
npm WARN javascript-coding-challenges No description
npm WARN javascript-coding-challenges No repository field.
npm WARN javascript-coding-challenges No README data
npm WARN javascript-coding-challenges No license field.
I am not entirely sure how to remedy this. Is it possible to "exit" from the current folder? (like cd ..
) This will allow github action to find the correct folder where package.json is located.
I've checked these two answers:
github actions can not find package.json
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Nuwanst\package.json'
but both of them are not answering my question (I see in first one changing uses
into ./
but I want to use this specific action)