cloudflare / workers-sdk

⛅️ Home to Wrangler, the CLI for Cloudflare Workers®
https://developers.cloudflare.com/workers/
Apache License 2.0
2.41k stars 592 forks source link

🚀 Feature Request: Inject secrets via CLI for vitest integration #6100

Closed carafelix closed 1 week ago

carafelix commented 1 week ago

Describe the solution

I want to set up a github action that run my vitest suite, but my worker depends on secrets. How should I inject them into the env object? locally it's not a problem. Miniflare reads them from the .dev.vars file, but on github actions the file does not exist ofc. I thought to be really convenient to have a way to inject secrets via the cli, since gh allows for that. If anyone know a better way to inject the secrets into the action, i'll close the issue

carafelix commented 1 week ago

just create a .dev.vars file in the gh action https://stackoverflow.com/questions/69006482/using-github-actions-to-create-a-env-file-in-the-workflow