Shopify / theme-check-action

Run shopify/theme-check on GitHub pull requests
Other
38 stars 14 forks source link

"Unexpected end of JSON input" error in v2 but not v1 #31

Closed LT-Jed closed 8 months ago

LT-Jed commented 9 months ago

When I try to run the standard Dawn13.0.0 theme through shopify/theme-check-action@v2 I recieve the following error. However if I run the same theme through shopify/theme-check-action@v1 it runs fine.

Output:

Run shopify/theme-check-action@v2
/usr/local/bin/npm install --no-package-lock --no-save @shopify/cli @shopify/theme

added [5](https://github.com/LT-Jed/dawn/actions/runs/7805591028/job/21290129489#step:3:6)40 packages in 25s

121 packages are looking for funding
  run `npm fund` for details
SyntaxError: Unexpected end of JSON input
Error: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at runChecksJson (/home/runner/work/_actions/shopify/theme-check-action/v2/dist/index.js:22:190[6](https://github.com/LT-Jed/dawn/actions/runs/7805591028/job/21290129489#step:3:7))
    at process.processTicksAndRejections (node:internal/process/task_queues:[9](https://github.com/LT-Jed/dawn/actions/runs/7805591028/job/21290129489#step:3:10)5:5)
    at async Promise.all (index 0)
    at async run (/home/runner/work/_actions/shopify/theme-check-action/v2/dist/index.js:22:29[11](https://github.com/LT-Jed/dawn/actions/runs/7805591028/job/21290129489#step:3:12)49)

Here is my current yml:

name: BuildStatus
on: [push]
jobs:
  theme-check:
    name: Theme Check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Theme Check
        uses: shopify/theme-check-action@v2
        with:
          token: ${{ github.token }}
          base: main
andrewwise commented 8 months ago

I'm getting the same thing:

I've made a public repository as an example.

Workflow: https://github.com/bravetheskies/theme-check-example/blob/main/.github/workflows/theme-check.yml

name: Theme Check
on: [push, workflow_dispatch]
jobs:
  theme-check:
    name: Theme Check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Theme Check
        uses: shopify/theme-check-action@v2
        with:
          theme_root: '.' # optional, could be './dist'
          token: ${{ github.token }}
          base: main

Action run log: https://github.com/bravetheskies/theme-check-example/actions/runs/7889797541/job/21530497919

Run shopify/theme-check-action@v2
  with:
    theme_root: .
    token: ***
    base: main
/usr/local/bin/npm install --no-package-lock --no-save @shopify/cli @shopify/theme
added 539 packages in 16s
1[2](https://github.com/bravetheskies/theme-check-example/actions/runs/7889797541/job/21530497919#step:3:2)1 packages are looking for funding
  run `npm fund` for details
/usr/bin/git fetch origin main
From https://github.com/bravetheskies/theme-check-example
 * branch            main       -> FETCH_HEAD
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at runChecksJson (/home/runner/work/_actions/shopify/theme-check-action/v2/dist/index.js:22:1906)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 0)
    at async run (/home/runner/work/_actions/shopify/theme-check-action/v2/dist/index.js:22:2911[4](https://github.com/bravetheskies/theme-check-example/actions/runs/7889797541/job/21530497919#step:3:4)[9](https://github.com/bravetheskies/theme-check-example/actions/runs/7889797541/job/21530497919#step:3:10))
Error: Unexpected end of JSON input
joantune commented 6 months ago

I'm still getting this exact same error - should have anything changed already or is it pending on a release? @charlespwd / @LT-Jed