From 878d78dd67da55fd747d775793fe762ff27fe4e4 Mon Sep 17 00:00:00 2001 From: Suneha Bose Date: Wed, 4 Nov 2026 11:37:26 -0800 Subject: [PATCH] fix: update Helm fallback to v4.3.1 --- README.md | 6 +++--- src/run.test.ts | 6 ++---- src/run.ts | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7ad398ff..865023cb 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/src/run.test.ts b/src/run.test.ts index 78057301..fffbc935 100644 --- a/src/run.test.ts +++ b/src/run.test.ts @@ -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` ) }) diff --git a/src/run.ts b/src/run.ts index 5183169b..cf575aaf 100644 --- a/src/run.ts +++ b/src/run.ts @@ -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')