fix(ci): fix GitHub Packages auth and upgrade CI to Node.js 22#28
Merged
fix(ci): fix GitHub Packages auth and upgrade CI to Node.js 22#28
Conversation
wendyyuchensun
approved these changes
Apr 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景描述 (Why)
Publish workflow 的
npm ci步驟在安裝@coseeing/nemeth2latex時出現 401 Unauthorized。原因是actions/setup-node設定registry-url後會建立自己的.npmrc(透過NPM_CONFIG_USERCONFIG指向/home/runner/work/_temp/.npmrc),完全覆蓋前一步手動寫入~/.npmrc的 auth token。該.npmrc使用NODE_AUTH_TOKEN環境變數認證,但npm ci步驟沒有設定這個變數。另外 GitHub Actions 已發出 Node.js 20 deprecation 警告,2026-06-02 起將強制使用 Node.js 24 runtime,且 Node.js 20 本身已 EOL。
實作方法 (How)
~/.npmrc的步驟(會被setup-node覆蓋,無效)npm ci步驟加上NODE_AUTH_TOKEN環境變數,讓setup-node產生的.npmrc能正確認證registry-url和scope設定,統一兩個 workflow 的認證方式actions/checkout和actions/setup-node從 v4 到 v5