voidzero-dev / voidzero-dev/vite-plus

vp run does not forward OIDC tokens from env (github action)

オープン
#2,189 コメント 1 件 リアクション 1 件 担当者 1 名 @naokihaba が担当を希望しています GitHub で見る
pending triage
主要言語
Rust
スター
5.8k
フォーク
262
平均マージ
1日 34分
マージ済み PR(30日)
135

説明

### Describe the bug

When running npm stage publish inside a vp run script, the OIDC environment variables set by github action are not correctly forwarded to the npm binary. That results in npm skiping OIDC authentication and falling back to node token authentication.

### Reproduction

see the steps to reproduce

### Steps to reproduce

from a publish.yml file, as soon as you replace this :

```yaml
- name: Working Publishing
env:
ACTIONS_ID_TOKEN_REQUEST_URL: ${{ env.ACTIONS_ID_TOKEN_REQUEST_URL }}
ACTIONS_ID_TOKEN_REQUEST_TOKEN: ${{ env.ACTIONS_ID_TOKEN_REQUEST_TOKEN }}
run: npm run -w release
```

```yaml
- name: Failing Publishing
env:
ACTIONS_ID_TOKEN_REQUEST_URL: ${{ env.ACTIONS_ID_TOKEN_REQUEST_URL }}
ACTIONS_ID_TOKEN_REQUEST_TOKEN: ${{ env.ACTIONS_ID_TOKEN_REQUEST_TOKEN }}
run: vp run release
```

the npm stage publish fails.
A silly log from npm clearly shows:
`npm silly oidc Skipped because incorrect permissions for id-token within GitHub workflow`

The main package.json script entry contains :
```json
"scripts": {
"release": "npm run -w release"
}
```

the final run command in the scoped package is
```json
"scripts": {
"release": "npm stage publish --provenance"
}
```

### System Info

```shell
Environment:
Version 24.18.0
Source engines.node
Source Path /home/runner/work/time-provider/time-provider/package.json
Project Root /home/runner/work/time-provider/time-provider
Tool Paths:
node /home/runner/.vite-plus/js_runtime/node/24.18.0/bin/node
npm /home/runner/.vite-plus/js_runtime/node/24.18.0/bin/npm
npx /home/runner/.vite-plus/js_runtime/node/24.18.0/bin/npx
Package Manager:
Name bun
Version 1.3.14
Source packageManager
Source Path /home/runner/work/time-provider/time-provider/package.json
Project Root /home/runner/work/time-provider/time-provider
Bin Path /home/runner/.vite-plus/package_manager/bun/1.3.14/bun/bin/bun

vp v0.2.4
Local vite-plus:
vite-plus v0.2.4
Tools:
vite v8.1.3
rolldown v1.1.4
vitest v4.1.10
oxfmt v0.57.0
oxlint v1.72.0
oxlint-tsgolint v0.24.0
tsdown v0.22.3
Environment:
Package manager bun v1.3.14
Node.js v24.18.0 (engines.node)
```

### Used Package Manager

bun

### Logs

```shell

```

### Validations

- [x] Read the [Contributing Guidelines](https://github.com/voidzero-dev/vite-plus/blob/main/CONTRIBUTING.md).
- [x] Check that there isn't [already an issue](https://github.com/voidzero-dev/vite-plus/issues) for the same bug.
- [x] Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- [x] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example).

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。