-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Use wrangler secret put instead of deprecated secret:bulk command #328
Conversation
`wrangler secret:bulk` is deprecated and will be removed in a future version. This also improves logging in cases where a secret is failing to upload because an environment variable with the same name already exists (see: #240).
@@ -241,26 +241,6 @@ function getEnvVar(envVar: string) { | |||
return value; | |||
} | |||
|
|||
async function legacyUploadSecrets( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we keep the legacy upload behavior for people on older versions of wrangler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, "wrangler", "secret:bulk"
is being deprecated, and "wrangler", "secret", "put"
is the current "legacy" way of doing things
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The legacy behavior is the current behavior :) The "new" behavior was the now-deprecated secret:bulk command.
All this PR does is replace the "non-legacy" behavior with the code from this function
We now have some baby tests in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based off of @WalshyDev feedback, we should probably use cloudflare/workers-sdk#5988 wrangler secret bulk
instead, if the user is on a newer version of wrangler where wrangler secret:bulk
was deprecated
Yeah, this would be a pretty major behavioural change to revert to the old method of setting individual secrets. Using |
Closing as this was not the right way to fix this. Looking into improving logging in bulk puts |
wrangler secret:bulk
is deprecated and will be removed in a future version.This improves logging in cases where a secret is failing to upload because an environment variable with the same name already exists (see: #240). Example:
With this change, we get this:
Testing:
Tested with a repo where the Worker already contains a secret of a different type:
https://github.com/jahands/wrangler-action-example/actions/runs/11895527967/job/33145312742