Skip to content

wrangler deployment overwrites env vars in the worker #8219

Answered by QingjiaTsang
QingjiaTsang asked this question in Q&A
Discussion options

You must be logged in to vote

Practice 1 :

  • use .dev.vars for development environment vars
  • make wrangler.toml.example file to record vars and secrets with placeholder values to indicate others
  • set up all the vars and secrets in wrangler.toml which is git ignored

But I found that doing in this way won't trigger cicd properly when I connect my github repo to the worker because the wrangler.toml file is git ignored, so I have to manually run the deploy cli command everytime.

(This is the practice I go with.)

Practice 2:

  • use .dev.vars for development environment vars
  • make comments for those secrets to indicate others and hardcode the insensitive vars (you can also make comments for those insensitive vars, up to you)
  • all…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by QingjiaTsang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant