Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package.json within a subdirectory could not be found #255

Open
Maelstromeous opened this issue Nov 2, 2024 · 0 comments
Open

package.json within a subdirectory could not be found #255

Maelstromeous opened this issue Nov 2, 2024 · 0 comments

Comments

@Maelstromeous
Copy link

Maelstromeous commented Nov 2, 2024

Hello,

I have an issue with your action where it is not detecting the package.json within a subdirectory, e.g. backend/package.json.

Here is the action in question:

name: "Backend: Build"

on:
  workflow_call:

jobs:
  build:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
        working-directory: backend ### Note this
    outputs:
      store-path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
          submodules: true

      - name: List all files in the working directory
        run: ls -la

      - name: Calculate the new version
        id: version
        uses: phips28/gh-action-bump-version@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          target-branch: main
          skip-commit: 'true'
          skip-tag: 'true'
          skip-push: 'true'
          tag-prefix: 'backend-'

The file backend/package.json does exist, the ls -la step outputs this:

>Run ls -la
total 148
drwxr-xr-x 5 runner docker  4096 Nov  2 11:40 .
drwxr-xr-x 7 runner docker  4096 Nov  2 11:40 ..
-rw-r--r-- 1 runner docker   771 Nov  2 11:40 package.json
-rw-r--r-- 1 runner docker 68455 Nov  2 11:40 pnpm-lock.yaml

I have tried supplying PACAKGEJSON_DIR: backend in the with as suggested by your documentation. It would be nice to know what directory it is checking in the error output to avoid confusion, as I've tried both with and without PACKAGEJSON_DIR and I have no idea which directory it's actually checking.

@Maelstromeous Maelstromeous changed the title Package.json could not be found package.json within a subdirectory could not be found Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant