Closed maxakuru closed 4 weeks ago
patch worker settings API for future reference
I see two options here that could preserve the settings:
PUT
we GET
https://developers.cloudflare.com/api/operations/worker-script-settings-get-settings (guard against 404) and then only update the script contents with https://developers.cloudflare.com/api/operations/worker-script-put-contentPUT
https://developers.cloudflare.com/api/operations/worker-script-upload-worker-module and replicate the settings that we just GET
ed (got) This would not require us to add more settings and could simplify the patch a bit.
looking more at this.. that makes sense, avoiding many extra settings and potentially being out of sync with CF
since params
are uploaded alongside the worker module, and it's possible someone adds a param after the initial deploy, I think it makes sense to go with your 2nd suggestion
:tada: This issue has been resolved in version 11.1.12 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
cloudflare worker deploy uses the upload worker module API which overwrites settings such as
logpush
we should add argument(s) to set cloudflare worker settings for the cloudflare target, at least for
logpush
but potentially for other worker settingsone option is to add
--cloudflare-setting-{key}
for the primitive value settings, for example--cloudflare-setting-logpush true
to enable logpush