Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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.
Acceptable values are `latest` or any semantic version string such as `v4.3.1`. The `latest` value follows Helm's current stable release and can change major versions.

```yaml
- uses: azure/setup-helm@v5
Expand All @@ -25,13 +25,13 @@ Alternatively, the version can be read from a [`.tool-versions`](https://asdf-vm
The action reads the version declared for the `helm` tool, for example:

```
helm 3.18.4
helm 4.3.1
```

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'`:
> If fetching the latest version fails, the action retries a few times and then uses the built-in fallback version (currently v4.3.1). This is a last-known stable version and can become a major version behind what `latest` resolves to. To fail the step with the underlying error instead, set `latest-fallback` to `'false'`:
>
> ```yaml
> - uses: azure/setup-helm@v5
Expand Down
6 changes: 2 additions & 4 deletions src/run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,10 @@ describe('run.ts', () => {
const fetchSpy = vi
.spyOn(globalThis, 'fetch')
.mockRejectedValue(new Error(errorMessage))
expect(await getLatestHelmVersionWithoutDelay()).toBe(
run.stableHelmVersion
)
expect(await getLatestHelmVersionWithoutDelay()).toBe('v4.3.1')
expect(fetchSpy).toHaveBeenCalledTimes(3)
expect(core.warning).toHaveBeenCalledWith(
expect.stringContaining(errorMessage)
`Error while fetching latest Helm release: ${errorMessage}. Using default version v4.3.1. Set 'latest-fallback' to 'false' to fail the step instead`
)
})

Expand Down
2 changes: 1 addition & 1 deletion src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as toolCache from '@actions/tool-cache'
import * as core from '@actions/core'

const helmToolName = 'helm'
export const stableHelmVersion = 'v3.18.4'
export const stableHelmVersion = 'v4.3.1'

export async function run() {
let version = core.getInput('version')
Expand Down
Loading