Repository navigation
Commit 106f36c
fix(cli): export OIDC-minted token to build env so prerender getToken sees it (review)
The single-step GitHub Actions workflow drops the curl/jq step that wrote
`VOID_TOKEN` to `$GITHUB_ENV`. `void deploy` now mints the deploy token
in-process, but assigned it only to a local variable. The downstream build
and prerender re-read credentials via `getToken()` (which reads
`process.env.VOID_TOKEN` first) — both in-process (`collectPrerenderPaths`)
and inside the spawned `vite build` child (`plugin-prerender`'s closeBundle,
which inherits `process.env` via `buildEnv`). A local variable reaches
neither, so in CI the prerender injected no `__VOID_TOKEN`/`__VOID_PROJECT_ID`
and rendered against local/empty bindings (AI, remote D1/KV/R2 break) —
a regression from the removed scaffold step.
Export the minted token to `process.env.VOID_TOKEN` right after masking,
inside the `!token` OIDC branch so an explicit `VOID_TOKEN` is never
overwritten. This restores exact parity with the removed `$GITHUB_ENV` write.
The token is the same deploy-scoped (`aud: deploy`, short-TTL) token the old
workflow exposed to the build, so visibility is parity, not new exposure.
The `command === 'serve'` gate on `__VOID_TOKEN` worker-var injection is
untouched, so this does not leak the token into `dist/ssr/wrangler.json`.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent e5faca6 commit 106f36c
2 files changed
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
407 | 419 | | |
408 | 420 | | |
409 | 421 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
95 | 101 | | |
96 | 102 | | |
97 | 103 | | |
| |||
150 | 156 | | |
151 | 157 | | |
152 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
153 | 188 | | |
154 | 189 | | |
155 | 190 | | |
| |||
297 | 332 | | |
298 | 333 | | |
299 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
300 | 340 | | |
0 commit comments