`mirror-token` is sent to GitHub instead of `token` when `mirror` is set
メンテナーはふだん 7 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- github-actions, node.js, typescript
調査の方向性
src/distributions/official_builds/official_builds.ts の getManifest と setupNodeJs から始めます。issue では、manifest リクエストとバイナリのダウンロードに使う認証情報の選択が指摘されています。tests/official-installer.test.ts と既存の mirror-token のケースを読み、GitHub と mirror の認証情報を対象とするテストを追加します。GitHub リクエストが GitHub token を使用し、mirror リクエストが引き続き mirror-token を使用すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description:
When both mirror and mirror-token are set, setup-node sends the mirror token to GitHub. It goes to two places in official_builds.ts:
- The
actions/node-versionsmanifest request throughtc.getManifestFromRepo, ingetManifest. - The binary download through
tc.downloadTool, insetupNodeJs. This URL comes from the manifest'sdownload_url, so it always points togithub.com/actions/node-versions/releases/....
Both use this pattern:
this.nodeInfo.mirror && this.nodeInfo.mirrorToken
? this.nodeInfo.mirrorToken
: this.nodeInfo.auth
This causes two problems:
- Security: A credential meant for a private mirror, such as an Artifactory token, gets sent to a third-party host. Mirror tokens should only go to the mirror.
- Rate limits: Because the mirror token replaces the GitHub
token, manifest calls are made without the GitHub token. That makes them more likely to hit GitHub API rate limits. #1548 fixed this only for the case wheremirror-tokenis empty.
The calls that do go to the mirror already use mirrorToken correctly: getNodeJsVersions, downloadNodejs, and the Windows fallback in base-distribution.ts.
Related: #1412, #1467, #1548, #1661
Action version:
actions/setup-node@v7 (current main, 7.1.0). This happens in every version that sends mirror-token to the manifest request.
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Tools version:
Any Node.js version that is in the actions/node-versions manifest. This doesn't depend on the package manager.
Repro steps:
- Use this step:
- uses: actions/setup-node@v7
with:
node-version: '24.9.0'
mirror: 'https://my-mirror.example.com'
mirror-token: ${{ secrets.MIRROR_TOKEN }}
- Pick a
node-versionthat is in theactions/node-versionsmanifest and not already in the runner's tool cache. - Watch the outgoing requests, for example with a proxy. The manifest request to the GitHub API and the binary download from
github.com/actions/node-versions/releases/...both sendAuthorization: <MIRROR_TOKEN>.
Expected behavior:
Requests to GitHub always use token, sent as token <token> (this.nodeInfo.auth). mirror-token is only sent to URLs built from mirror.
Actual behavior:
mirror-token is sent to the GitHub API and to github.com release downloads instead of the GitHub token. This sends the mirror credential to GitHub, and the manifest call is made without the GitHub token.
Proposed fix:
- In
official_builds.ts, passthis.nodeInfo.authto bothtc.getManifestFromRepoand the manifest-basedtc.downloadToolcall. Remove themirror && mirrorTokenternary. - Add tests to
__tests__/official-installer.test.ts. No current test checks this case. The existingmirror-tokentests only check log messages and that a download happened. With bothmirrorandmirror-tokenset, the new tests should check that:getManifestFromRepois called with'token <token>', not the mirror token.downloadToolgets'token <token>'for thegithub.com/actions/node-versions/releases/...URL.- Requests to the mirror still use
mirror-token.
- 主要言語
- TypeScript
- スター
- 5k
- フォーク
- 1.7k
- 平均マージ
- 5日 1時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
actions/setup-node のほかの issue
-
feature request
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
actions/setup-node#1531 · コメント 1 件 · リアクション 4 件 ·
メンテナーはふだん 7 日以内に返信
-
bug: pnpm cache hits provide little install speedup because lockfile verification is not cachedオープンbug needs triage
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
actions/setup-node#1672 ·
メンテナーはふだん 7 日以内に返信
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
actions/setup-node#1670 · コメント 1 件 ·
メンテナーはふだん 7 日以内に返信
-
Provide `allow-prereleases` (or similar) option for Node.js 27 Alpha対応中かも @v-priyagupta108 が 7 日前に担当しました。 オープンfeature request
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
actions/setup-node#1657 · コメント 5 件 · リアクション 4 件 · 担当者 1 名 ·
メンテナーはふだん 7 日以内に返信
-
Improved error message when a required os lib is missing対応中かも @OKAN-SOFTWARE が 20 日前に担当しました。 オープンfeature request
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
actions/setup-node#1651 · コメント 1 件 ·
メンテナーはふだん 7 日以内に返信
actions/setup-node の issue をすべて見る
似ている issue
-
db-d1-sqlite: upsert is aliased to updateOne, so payload.kv.set never inserts new keys対応中かも @pcbeingused333 が今日担当しました。 オープンBug db: d1-sqlite Payload OSS
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
payloadcms/payload#19766 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
device-management-toolkit/sample-web-ui#3711 ·
メンテナーはふだん 1 日以内に返信
-
bug impact:low Team: SecuritySolution Team:Defend Workflows v9.6.0
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
elastic/kibana#306401 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
agentes-chat/agentes-chat#927 ·
メンテナーはふだん 1 日以内に返信
-
Closing a pinned tab jumps to the Tabs section instead of the next open pinned tab対応中かも @seenimohamed が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ardia-browser/ardia#2769 ·
メンテナーはふだん 1 日以内に返信