Skip to content

feat: add --secrets-file to cf previews deploy - #537

Draft
edmundhung wants to merge 2 commits into
mainfrom
edmundhung/previews-deploy-secrets-file
Draft

edmundhung wants to merge 2 commits into
mainfrom
edmundhung/previews-deploy-secrets-file

Conversation

@edmundhung

Copy link
Copy Markdown
Member

Summary

Add --secrets-file to cf previews deploy. It accepts the same JSON or .env file format as cf deploy --secrets-file. Right now cf has no way to give a Preview its secrets: they have to be set in the dashboard or with wrangler preview secret put.

The flag is passed to previewBuildOutput(). That function parses the file the same way cf deploy does and uploads each entry as a secret on the Preview deployment. The help text reuses the cf deploy description, reworded for a Preview deployment. Typed metadata, the generated command catalogs, tests, and a minor changeset are included.

Dependencies

Depends on cloudflare/workers-sdk#16751, which adds secretsFile to the previewBuildOutput() arguments. Until that ships, @cloudflare/deploy-helpers is pinned to the PR's pkg.pr.new build, and its sibling dependencies are overridden to the released versions cf already uses, the same approach as #163. Swap the pin and overrides for the released version before merging.

@pkg-pr-new

pkg-pr-new Bot commented Nov 6, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/cf@537

commit: 220999d

@ask-bonk

ask-bonk Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

cf --help startup

mean stddev min max
PR 286.7 ms 12.0 ms 277.5 ms 321.5 ms
base 284.1 ms 4.0 ms 280.1 ms 293.6 ms

Δ (PR vs base): ↑ +2.5 ms (+0.9%)

Measured with hyperfine on ubuntu-latest (3 warmup runs, 20 timed runs). CI numbers carry ±a few ms of runner jitter; treat small deltas as noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant