Skip to content

fix: publishワークフローのnpmをv11にピン留めしてsigstoreバグを回避 - #56

Merged
getty104 merged 1 commit into
mainfrom
fix/pin-npm11-publish-workflow
Jul 10, 2026
Merged

getty104 merged 1 commit into
mainfrom
fix/pin-npm11-publish-workflow

Conversation

@getty104

@getty104 getty104 commented Jul 10, 2026 •

Copy link
Copy Markdown
Owner

概要

npm publish --provenance が以下のエラーで失敗する問題の修正です。

npm error code MODULE_NOT_FOUND
npm error Cannot find module 'sigstore'

原因

  • publish.yml の「Ensure npm supports trusted publishing (OIDC)」ステップが npm install -g npm@latest を実行している
  • npm@latest が 12.0.0 に更新されたが、npm 12.0.0 の公開tarballにはルートの node_modules/sigstore/ が同梱されないパッケージングバグがある (npm/cli#9722)
  • その結果 libnpmpublish/lib/provenance.js の require('sigstore') が解決できず、--provenance 付き publish がクラッシュする

対応

  • npm install -g npm@latest → npm install -g npm@11 にピン留め
  • npm 11 系 (現在 11.18.0) は sigstore が正しく同梱されており、trusted publishing / OIDC に必要な npm >= 11.5.1 も満たす
  • npm 側の修正 (npm/cli#9740) がリリースされたら @latest に戻してよい

🤖 Generated with Claude Code

Summary by CodeRabbit

  • バグ修正
    • パッケージ公開時に発生する署名・検証関連のエラーを修正しました。
    • npm の使用バージョンを安定したバージョン系列に固定し、公開処理の再現性と信頼性を向上させました。
    • これにより、リリース時の公開失敗が発生しにくくなります。

npm 12.0.0 (現在のnpm@latest) は公開tarballにsigstoreが同梱されておらず、
npm publish --provenance が MODULE_NOT_FOUND で失敗する (npm/cli#9722)。
trusted publishing (OIDC) に必要な npm >= 11.5.1 を満たす npm@11 に
ピン留めして回避する。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 31d50f98-e3a3-4560-addf-d86ecb4643d6

📥 Commits

Reviewing files that changed from the base of the PR and between 9d28174 and 44c7e5e.

📒 Files selected for processing (1)
  • .github/workflows/publish.yml

📝 Walkthrough

Walkthrough

公開ワークフローで使用するグローバル npm を npm@latest から npm@11 に固定し、trusted publishing の provenance 公開に必要な sigstore に関する理由をコメントで明記しました。

Changes

npm 公開ワークフロー

Layer / File(s) Summary
npm バージョン固定
.github/workflows/publish.yml
グローバル npm のインストール対象を npm@11 に変更し、npm@latest では bundled sigstore が不足して --provenance 公開に失敗する旨のコメントを追加しました。

Estimated code review effort: 2 (Simple) | ~5 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pin-npm11-publish-workflow

Comment @coderabbitai help to get the list of available commands.

@getty104
getty104 merged commit 1c82f56 into main Jul 10, 2026
1 of 2 checks passed
@getty104
getty104 deleted the fix/pin-npm11-publish-workflow branch July 10, 2026 12:43
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.

1 participant