Skip to content

HttpError: Invalid response body while trying to fetch #452

Description

@Rolleander

Describe a bug

My setup used to work fine for over a year and suddenly stopped working with the following error:

Error: HttpError: Invalid response body while trying to fetch https://api.github.com/repos/MDP-Fundraising/functions/pulls/169: Premature close
HttpError: Invalid response body while trying to fetch https://api.github.com/repos/MDP-Fundraising/functions/pulls/169: Premature close
    at /home/runner/work/_actions/ArtiomTr/jest-coverage-report-action/v2/dist/index.js:8:325085
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    at async Zx (/home/runner/work/_actions/ArtiomTr/jest-coverage-report-action/v2/dist/index.js:2136:3627)
    at async _r (/home/runner/work/_actions/ArtiomTr/jest-coverage-report-action/v2/dist/index.js:2137:158)
    at async jN (/home/runner/work/_actions/ArtiomTr/jest-coverage-report-action/v2/dist/index.js:2146:15213)
(node:2205) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
Initialization stage ended
/home/runner/work/_actions/ArtiomTr/jest-coverage-report-action/v2/dist/index.js:2146
Default "index" lookups for the main are deprecated for ES modules.`,"DeprecationWarning","DEP0151")}function Ay(e){try{return(0,ol.statSync)(e)}catch(t){return new ol.Stats}}function CO(e,t,i){let a=Ah.get(e);if(a!==void 0)return a;let u=nse.read(e).string;if(u===void 0){let f={pjsonPath:e,exists:!1,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};return Ah.set(e,f),f}let r;try{r=JSON.parse(u)}catch(f){throw new wy(e,(i?`"${t}" from `:"")+(0,kt.fileURLToPath)(i||t),f.message)}let{exports:p,imports:s,main:d,name:c,type:n}=r,o={pjsonPath:e,exists:!0,main:typeof d=="string"?d:void 0,name:typeof c=="string"?c:void 0,type:n==="module"||n==="commonjs"?n:"none",exports:p,imports:s&&typeof s=="object"?s:void 0};return Ah.set(e,o),o}function xy(e){let t=new URL("./package.json",e);for(;!t.pathname.endsWith("node_modules/package.json");){let r=CO((0,kt.fileURLToPath)(t),e);if(r.exists)return r;let p=t;if(t=new URL("../package.json",t),t.pathname===p.pathname)break}let i=(0,kt.fileURLToPath)(t),a={pjs
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
Error: Initialization failed.
    at jN (/home/runner/work/_actions/ArtiomTr/jest-coverage-report-action/v2/dist/index.js:2146:15292)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
Node.js v24.17.0

Seems like something changed in the github api?

Expected behavior

It should work again like before, i did not change any configuration on my side

Details

Workflow:

name: Cloud Function Tests

on:
  push:
    branches: ["**"]

permissions: write-all

jobs:
  functions-test:
    runs-on: ubuntu-latest
    env:
      TZ: Europe/Berlin
    steps:
      - name: Checkout repository
        uses: actions/checkout@v5

      - name: Set up Node.js
        uses: actions/setup-node@v6
        with:
          node-version: "24"

      - name: Set up Java 21
        uses: actions/setup-java@v4
        with:
          distribution: temurin
          java-version: "21"

      - name: Install dependencies
        run: |
          npm ci

      - name: Find PR Context
        uses: jwalton/gh-find-current-pr@v1.3.3
        id: findPr

      - name: Start Firebase Emulator
        run: |
          npx firebase emulators:start --only firestore --project=demo-test &
          sleep 3
          for i in {1..10}; do
          nc -z 127.0.0.1 8080 && echo "Firebase emulator ready" && exit 0
          echo "Waiting for Firebase emulator..."
          sleep 3
          done
          echo "Firebase emulator did not start in time"
          exit 1

      - name: Run Jest with Coverage
        uses: ArtiomTr/jest-coverage-report-action@v2
        with:
          skip-step: install
          test-script: npx jest --testTimeout=30000 --json --coverage --runInBand --testLocationInResults --outputFile=report.json
          prnumber: ${{ steps.findPr.outputs.number }}
          annotations: none

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions