Skip to content

chore: parse pack --json object output in node integration#9747

Merged
reggi merged 1 commit into
latestfrom
reggi/fix-node-integration-pack-json
Jul 10, 2026
Merged

chore: parse pack --json object output in node integration#9747
reggi merged 1 commit into
latestfrom
reggi/fix-node-integration-pack-json

Conversation

@reggi

@reggi reggi commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Problem

The build nodejs jobs in Release Integration / publish fail at .github/workflows/node-integration.yml:

node . pack --loglevel=silent --json | jq -r .[0].filename
→ jq: error (at <stdin>:9859): Cannot index object with number
→ Process completed with exit code 5

As of #9247 (sync json output of pack and publish), npm pack --json no longer outputs an array. logTar now buffers { [tar.name]: tarball }, so the output is an object keyed by package name:

{ "npm": { "filename": "npm-12.0.1.tgz", ... } }

The workflow still parsed it with .[0].filename, which errors on an object. npm 12.0.x is the first release carrying this change, so the release integration only started breaking now.

Fix

Parse the filename from the object instead of an array index:

-npmtarball="$(node . pack --loglevel=silent --json | jq -r .[0].filename)"
+npmtarball="$(node . pack --loglevel=silent --json | jq -r 'to_entries[0].value.filename')"

Verified locally: returns npm-12.0.1.tgz.

@reggi reggi requested review from a team as code owners July 10, 2026 17:31
@reggi reggi changed the title fix: parse pack --json object output in node integration chore: parse pack --json object output in node integration Jul 10, 2026
martinrrm
martinrrm previously approved these changes Jul 10, 2026
npm pack --json now emits an object keyed by package name (#9247)
instead of an array, so the release integration workflow's
jq -r .[0].filename fails with 'Cannot index object with number'.
Parse the filename from the object instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 91528ac3-495a-4617-9630-c31478a0691f
@reggi reggi force-pushed the reggi/fix-node-integration-pack-json branch from 7a7b9d6 to 15459a1 Compare July 10, 2026 17:46
@reggi reggi merged commit 7b1f6c1 into latest Jul 10, 2026
26 checks passed
@reggi reggi deleted the reggi/fix-node-integration-pack-json branch July 10, 2026 18:50
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

Successfully merging this pull request may close these issues.

2 participants