Repository navigation
fix(cli): read dotenv files correctly in void secret sync - #616
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://fix-secret-sync-dotenv-void-cloud.voidzero-docs.workers.dev (commit 8307197)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
31aefeb to
69db2fd
Compare
💡 Codex Reviewvoid/packages/void/src/auth/config.ts Lines 104 to 105 in 69db2fd void prepare independent of application plugin startup
For projects with an AGENTS.md reference: packages/void/AGENTS.md:L169-L169 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
`void secret sync` used its own line parser. It kept inline comments and quotes in the value, so `KEY=sk_live_x # note` or `KEY="abc" # note` was uploaded as written, with no error. It also rejected `export KEY=...` lines and multi-line quoted values such as PEM keys. Parse the file with Node's `parseEnv`, the same dotenv rules `.env` loading uses. `$VAR` references stay literal, so a `$` in a secret is uploaded unchanged. Lines without `=` are now skipped, as in `.env` loading; the found names are still listed before the confirm prompt. A leading UTF-8 byte order mark is dropped before parsing, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
69db2fd to
8307197
Compare
|
Fixed in 106d132 on #611, which this PR is stacked on. |
Auto-merge was disabled for another pull request in the stack
Problem
void secret sync <file>used its own dotenv parser. It uploaded values likesk_live_x # noteor"abc" # noteexactly as written, with no error. It also could not readexport KEY=...lines or multi-line quoted values such as PEM keys.What changed
parseDotenvFileinpackages/void/src/cli/secret.tsnow uses Node'sutil.parseEnv, the same dotenv rules.envloading uses.parseDotenvhelper, because that expands$VAR. A$in a secret must stay as written.parseEnvwould keep it in the first name.Tests
packages/void/test/unit/secret-sync.test.tsadds tests for inline comments, quoted values followed by a comment, theexportprefix, multi-line and\nvalues,$VARstaying unexpanded, and a file that starts with a byte order mark.Choices to check
=are now skipped, as in.envloading, instead of failing. The found names are still listed before the confirm prompt.parseEnvreturns keys sorted.🤖 Generated with Claude Code