Skip to content

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

@Maelstromeous

Description

@Maelstromeous

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions