wrangler-action
wrangler-action copied to clipboard
Wrangler is reinstalled even when it's already available
Currently, wrangler-action
always installs wrangler as specified by the wranglerVersion
input or the DEFAULT_WRANGLER_VERSION
constant contained in the source. This isn't always necessary as Wrangler may have already been installed in a previous step of the workflow (e.g. if it's declared in the project's dependencies in package.json
). This also makes it harder to keep the version of Wrangler used by wrangler-action
and the version used locally consistent, as the user needs to manually keep wranglerVersion
and package.json
in sync.
Instead, we should only install Wrangler if it's not already present in the $PATH
(including the package manager bin directory) OR if wranglerVersion
has been explicitly provided