Skip to content

fix: correct package.json path in version-and-commit.mjs for monorepo#18

Merged
konard merged 4 commits intomainfrom
issue-17-4fb92dabeabb
Jan 10, 2026
Merged

fix: correct package.json path in version-and-commit.mjs for monorepo#18
konard merged 4 commits intomainfrom
issue-17-4fb92dabeabb

Conversation

@konard
Copy link
Member

@konard konard commented Jan 10, 2026

Summary

Fixes the npm publish failure for v0.5.1 by correcting a path bug in version-and-commit.mjs.

Root Cause Analysis

There were two distinct issues that caused the v0.5.1 publish failure:

Issue 1: npm OIDC Token Error (First Run Attempt)

The original npm publish attempt failed with:

🦋  error an error occurred while publishing browser-commander: E404 Not Found - PUT https://registry.npmjs.org/browser-commander - Not found 
🦋  error The requested resource 'browser-commander@0.5.1' could not be found or you do not have permission to access it.
🦋  error npm notice Security Notice: Classic tokens have been revoked. Granular tokens are now limited to 90 days and require 2FA by default.
🦋  error npm notice Access token expired or revoked.

This indicates that npm OIDC trusted publishing may not be properly configured on npm's side.

Required action: Verify that npm OIDC trusted publishing is properly configured for the browser-commander package on npmjs.com.

Issue 2: Wrong package.json Path (Rerun Attempt - FIXED)

When the CI run was restarted, it failed with a different error in version-and-commit.mjs:

fatal: path 'js/package.json' exists, but not 'package.json'
hint: Did you mean 'origin/main:js/package.json' aka 'origin/main:./package.json'?
Error: Unexpected end of JSON input

Root cause: The script used git show origin/main:package.json but this monorepo has the JS package at js/package.json. The git show command uses repository root paths, not the workflow's working-directory: js setting.

Changes

  • Fixed the path in version-and-commit.mjs from package.json to js/package.json for the git show command

Current State

  • GitHub release v0.5.1 exists (version bump was committed in first attempt)
  • npm only has up to v0.4.0 (publish step never succeeded)
  • v0.5.0 was also never published to npm

After Merging This PR

After this PR is merged, the maintainer needs to:

  1. Verify npm OIDC trusted publishing setup on npmjs.com:

    • Go to npmjs.com → Your packages → browser-commander → Settings → Publishing access
    • Ensure GitHub Actions OIDC is properly configured for this repository
  2. Manually publish v0.5.1 using one of these methods:

    • Option A: Trigger a manual instant release via GitHub Actions workflow_dispatch
    • Option B: Run npm publish locally with proper credentials

    Note: Since v0.5.1 GitHub release already exists, the CI won't automatically re-publish. A manual trigger is needed.

Fixes #17


🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #17
@konard konard self-assigned this Jan 10, 2026
The git show command uses repository root paths, not the workflow's
working directory. Since this is a monorepo with js/ and rust/ folders,
the path must be js/package.json instead of just package.json.

This was causing "Unexpected end of JSON input" errors when the script
tried to read package.json (which doesn't exist at repo root) instead
of js/package.json.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard changed the title [WIP] npm publish failed for v0.5.1 - Access token expired or revoked fix: correct package.json path in version-and-commit.mjs for monorepo Jan 10, 2026
konard and others added 2 commits January 10, 2026 01:42
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard marked this pull request as ready for review January 10, 2026 00:46
@konard
Copy link
Member Author

konard commented Jan 10, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $4.804450 USD
  • Calculated by Anthropic: $3.430589 USD
  • Difference: $-1.373861 (-28.60%)
    📎 Log file uploaded as GitHub Gist (570KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard konard merged commit 18dd2bd into main Jan 10, 2026
9 checks passed
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.

npm publish failed for v0.5.1 - Access token expired or revoked

1 participant