Skip to content

ci: handle array output from npm info --json in release workflow - #1793

Merged
arthurschreiber merged 1 commit into
masterfrom
claude/review-action-noise-98mfq9
Sep 23, 2026
Merged

arthurschreiber merged 1 commit into
masterfrom
claude/review-action-noise-98mfq9

Conversation

@arthurschreiber

Copy link
Copy Markdown
Collaborator

The daily Release workflow promotes next to latest once a release has spent a week on next. Since it installs npm@latest, it now runs npm 12, which always wraps npm info --json output in an array, even for a single package. The jq '."dist-tags".next' lookup then fails with Cannot index array with string, so next hasn't been promoted to latest for weeks.

Changes

release.yml now normalizes the npm info output to the object form (if type == "array" then .[0] else . end) before reading dist-tags and time. That works with both old and new npm.

Testing

  • Ran the jq filter on both shapes (a bare object and a one-element array). Both return the next version.
  • The workflow YAML parses.
  • The Release workflow only runs on its schedule or by manual dispatch. Running it by hand after merge will confirm the fix.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DVJokgF4h8GvwVHYikKMDY


Generated by Claude Code

npm 12 always wraps `npm info --json` output in an array, even for a
single package. Since the workflow installs npm@latest, the jq lookup of
`."dist-tags"` has been failing with "Cannot index array with string",
so `next` has not been promoted to `latest` for weeks. Normalize the
output to the object form so it works with both old and new npm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DVJokgF4h8GvwVHYikKMDY
@arthurschreiber
arthurschreiber merged commit 98033a2 into master Sep 23, 2026
25 of 27 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 20.3.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants