phips28 / gh-action-bump-version

GitHub Action for automated npm version bump.
MIT License
336 stars 249 forks source link

Getting Error: package.json could not be found in your project's root when using custom `package.json` path configuration #162

Closed ugreg closed 6 months ago

ugreg commented 2 years ago

Getting error (node:1857) UnhandledPromiseRejectionWarning: Error: package.json could not be found in your project's root. when using custom package json path configuration.

    - name:  'Automated Version Bump'
      uses:  'phips28/gh-action-bump-version@master'
      with:
        PACKAGEJSON_DIR: 'www_themade_org'

image

phips28 commented 2 years ago

Unfortunately I have no idea at the moment why its not working, and really busy with RL 🙈
This code part is from another contributor. Maybe you can check the code and see if you find the error, then we could merge a PR.

apwide-magnus commented 2 years ago

Don't know if it will help but I had a similar issue that I solved by adding the checkout step that I had forgotten as in the example (https://github.com/phips28/gh-action-bump-version/blob/master/.github/workflows/push.yml).

SpoonOfDoom commented 2 years ago

I had the same issue, and it took me a whole day to catch my simple error: the PACKAGEJSON_DIR element must go into the env block instead of the with block. Looking at your code snippet, you seem to have made the same mix-up. Try this out and see if it works:

- name:  'Automated Version Bump'
  uses:  'phips28/gh-action-bump-version@master'
  env:
    PACKAGEJSON_DIR: 'www_themade_org'