Thomas Seljen TvedtandGitHub 531fb92ec6 fix: retry latest version lookup and add latest-fallback opt-out (#303)
* fix: retry latest version lookup and add latest-fallback opt-out

Resolving 'version: latest' made a single request to
https://get.helm.sh/helm-latest-version and, on any failure, silently
installed the hard-coded default version. Since 'latest' resolves to
Helm 4, that fallback moves a job back a whole major version while the
step stays green.

Retry the lookup a few times with a short backoff, treat non-2xx
responses as failures instead of installing the response body, and add
a 'latest-fallback' input so callers can make the step fail instead of
installing the default version. The default keeps the existing
behavior.

* fix: do not fall back across a major version by default

Make 'latest-fallback' default to 'false', so an exhausted lookup fails
the step with the underlying error instead of installing the built-in
default version, which can be a major behind what 'latest' resolves to.
Setting the input to 'true' restores the previous behavior.

* fix: keep latest-fallback on by default

Installing the built-in default version when 'latest' cannot be
determined is documented behavior for v5, so 'latest-fallback' now
defaults to 'true' and callers opt out with 'false'. The warning
emitted on fallback names the input, so the downgrade is easy to trace
and to turn off.

* fix: cancel the unread body of a failed latest version response

A non-2xx response from the latest version URL is turned into an error
without reading its body. Cancel the body first, so its connection is
released before the next attempt instead of waiting for garbage
collection.
2026-11-04 10:50:29 -08:00
2025-07-03 09:53:58 +12:00
2022-06-27 18:27:44 -04:00
2022-06-27 18:27:44 -04:00
2022-06-27 18:27:44 -04:00
2019-09-23 02:03:33 -07:00

Setup Helm

Install a specific version of helm binary on the runner.

Example

Acceptable values are latest or any semantic version string like v3.5.0 Use this action in workflow to define which version of helm will be used. v2+ of this action only support Helm3.

- uses: azure/setup-helm@v5
  with:
     version: '<version>' # default is latest (stable)
  id: install

Alternatively, the version can be read from a .tool-versions file (the format used by asdf and mise) via the version-file input:

- uses: azure/setup-helm@v5.0.0
  with:
     version-file: .tool-versions
  id: install

The action reads the version declared for the helm tool, for example:

helm 3.18.4

If both version and version-file are set, an explicitly requested version takes precedence and version-file is ignored (a warning is emitted). Because version defaults to latest, version-file is only ignored when you set version to a specific value other than latest; if version is left at its default, the version from version-file is used.

Note

If fetching the latest version fails, the action retries a few times and then uses the hardcoded default version (currently v3.18.4). That default can be a major version behind what latest resolves to. To fail the step with the underlying error instead, set latest-fallback to 'false':

- uses: azure/setup-helm@v5
  with:
     version: 'latest'
     latest-fallback: 'false'

If you rely on a certain version, you should explicitly request that version instead of latest.

The cached helm binary path is prepended to the PATH environment variable as well as stored in the helm-path output variable. Refer to the action metadata file for details about all the inputs https://github.com/Azure/setup-helm/blob/master/action.yml

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Support

setup-helm is an open source project that is not covered by the Microsoft Azure support policy. Please search open issues here, and if your issue isn't already represented please open a new one. The project maintainers will respond to the best of their abilities.

S
Description
No description provided
Readme MIT
31 MiB
Languages
TypeScript 100%