Skip to content

fix(ci): install npm 11 for OIDC Trusted Publishing#102

Merged
miya0001 merged 1 commit into
mainfrom
fix/oidc-publish-v2
Apr 5, 2026
Merged

fix(ci): install npm 11 for OIDC Trusted Publishing#102
miya0001 merged 1 commit into
mainfrom
fix/oidc-publish-v2

Conversation

@miya0001

@miya0001 miya0001 commented Apr 5, 2026

Copy link
Copy Markdown
Member

Summary

  • publish 前に npm install -g npm@11 を追加
  • npm 10.x は OIDC Trusted Publishing に非対応(ENEEDAUTH の原因)
  • npm 11.5.1+ でネイティブ OIDC トークン交換をサポート
  • registry-url を復元(.npmrc のレジストリ設定に必要)

経緯

Test plan

  • CI が通ることを確認
  • マージ後、v0.10.1 タグを作成して publish が成功することを確認

Summary by CodeRabbit

リリースノート

  • その他(Chores)
    • パッケージ公開プロセスのインフラストラクチャを改善しました。npm レジストリ設定を明示的に構成し、ビルド後の処理を最適化しています。

@coderabbitai

coderabbitai Bot commented Apr 5, 2026

Copy link
Copy Markdown
📝 Walkthrough

概要(Walkthrough)

パブリッシュワークフローが actions/setup-node@v4 に明示的な npm レジストリ URL を設定し、ビルドステップ後に npm をバージョン 11 にアップグレードするステップを追加しました。OIDC トラストされたパブリッシング機能は変更されていません。

変更内容(Changes)

コホート / ファイル 概要
GitHub Actions ワークフロー設定
.github/workflows/publish.yml
npm レジストリ URL を明示的に https://registry.npmjs.org に設定し、パブリッシュ前に npm を グローバルにバージョン 11 にアップグレードするステップを追加。

見積もりコードレビュー工数

🎯 1 (Trivial) | ⏱️ ~3 minutes

関連の可能性のあるプルリクエスト

  • fix(ci): enable npm OIDC Trusted Publishing #101: 同じパブリッシュワークフローの actions/setup-node 設定を修正し、レジストリ URL と OIDC 認証の動作を変更しているため関連。
  • Install npm@latest for OIDC trusted publishing #41: パブリッシュワークフロークの actions/setup-node にレジストリ URL を設定し、npm を 11+ バージョンにアップグレードする OIDC トラストされたパブリッシング用のステップを追加しているため関連。

🐰 npm を整え、レジストリを指し、
バージョン 11 へ優雅に飛び立つ
OIDC の信頼、確かに結ばれ、
パッケージの旅は、安全に続く ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed プルリクエストのタイトルは、npm 11のインストールによるOIDC Trusted Publishingサポートの追加という主要な変更を正確に反映しており、変更内容と完全に関連しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/publish.yml (1)

80-81: npm の最小要件である 11.5.1 を明示的に指定してください。

現在の npm@11 は OIDC Trusted Publishing が要求する最小バージョン 11.5.1(公式ドキュメント: https://docs.npmjs.com/trusted-publishers/)よりも古いバージョンに解決される可能性があります。将来の 11.x リリースで CI 動作が変わるのを防ぐため、最小対応版に明示固定し、実行時にバージョン確認を入れることをお勧めします。

推奨される変更
-      - name: Upgrade npm for OIDC Trusted Publishing
-        run: npm install -g npm@11
+      - name: Upgrade npm for OIDC Trusted Publishing
+        run: |
+          npm install -g npm@11.5.1
+          npm --version
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/publish.yml around lines 80 - 81, Replace the loose npm
upgrade step "Upgrade npm for OIDC Trusted Publishing" that runs `npm install -g
npm@11` with a pinned minimum version of 11.5.1 by installing `npm@11.5.1`, and
add a runtime verification immediately after (e.g., `npm --version`) to fail the
job if the resolved npm version is older than 11.5.1; update the step name to
reflect the pinned minimum version so it's clear in the workflow output.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/publish.yml:
- Around line 80-81: Replace the loose npm upgrade step "Upgrade npm for OIDC
Trusted Publishing" that runs `npm install -g npm@11` with a pinned minimum
version of 11.5.1 by installing `npm@11.5.1`, and add a runtime verification
immediately after (e.g., `npm --version`) to fail the job if the resolved npm
version is older than 11.5.1; update the step name to reflect the pinned minimum
version so it's clear in the workflow output.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 04ad8029-8d9f-45a8-9950-02be5cf8a0bd

📥 Commits

Reviewing files that changed from the base of the PR and between 12ce2f7 and b918b5b.

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

@miya0001
miya0001 merged commit e9be5e4 into main Apr 5, 2026
7 checks passed
@miya0001
miya0001 deleted the fix/oidc-publish-v2 branch April 5, 2026 16:34
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