Commit Graph
40 Commits
Author SHA1 Message Date
David GameroandGitHub 4339b0e932 feat: verify Helm downloads and support fallback mirrors (#315)
* feat: verify Helm downloads and support fallback mirrors

* fix: strengthen Helm download fallback

* docs: align mirror example with Helm fallback

* fix: preserve custom mirror checksum compatibility

* fix: warn for missing checksums in auto mode
2026-11-09 12:18:18 -08:00
Suneha BoseandGitHub 1548e57b4d fix: update Helm fallback to v4.3.1 (#314) 2026-11-05 12:34:19 -05:00
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
Ogheneobukome EjaifeandGitHub 249bb27705 feat: resolve latest patch for a major.minor version (#293)
* feat: resolve latest patch for a major.minor version

Allow the version input and version-file entries to be a major.minor value like
3.14 / v3.14, resolving to the newest available patch (e.g. v3.14.4).

Resolution probes the download host directly: sequential HEAD requests for
helm-v{major}.{minor}.{n} against downloadBaseURL, taking the highest that
returns 200. Works with any file-serving mirror and needs no token or extra
dependency, and cannot resolve to a version that is not downloadable. Only
major.minor.n URLs are probed, so prereleases are never considered.

- Add isMajorMinorShaped, helmPatchExists, and resolveLatestPatchVersion.
- Walk stops after 3 consecutive 404s (look-ahead) to tolerate a skipped patch
  number, with a 100-probe safety cap; hitting the cap throws instead of
  returning a bogus version.
- Wire resolution into run() and relax getVersionFromToolVersionsFile to accept
  a major.minor value.

* feat: support .x/.* wildcards and harden patch probing

Extend the major.minor latest-patch resolution to accept wildcard patch syntax (`3.12.x`, `v3.12.x`, `3.12.*`), matching the syntax requested in Azure/setup-helm#109.

The following smaller fixes were made based on Copilot review feedback:

- helmPatchExists now treats only 404 as "patch absent"; any other non-2xx status (403/405/429/5xx) and network errors are thrown, so rate-limiting, outages, or a host that disallows HEAD can no longer be misread as a missing patch (which could yield a stale version or a false "No Helm releases found").
- Clarify the version-file validation error to reflect that both a full version and a major.minor value are accepted, with concrete examples.
- Tests: use vi.spyOn(globalThis, 'fetch') instead of vi.stubGlobal so restoreAllMocks() reliably restores fetch and the mock never leaks across tests; add coverage for wildcards and the non-404 throw path.

* ### feat: single-request listing fast-path + semver.org validation

**Listing fast-path (with fallback).** Following the discussion about enumeration, `resolveLatestPatchVersion` now first tries a single Azure Blob container-listing request against the download host (which `get.helm.sh` backs), and only falls back to the sequential HEAD-probe walk if the host doesn't return a valid listing. Enumeration and download stay on the **same host**, so there's no risk of resolving a version the host can't serve, and it still works on any mirror.

- Default host: resolution now takes **1 request** instead of ~8 probes (verified live: `3.9`→`v3.9.4`, `3.12`→`v3.12.3`, `3.14`→`v3.14.4`, `3.16`→`v3.16.4`, `2.17`→`v2.17.0`).
- Non-listing hosts fall back to probing; prereleases and `.sha256` sidecars are excluded from the listing parse.

**semver.org regex.** Per review feedback, `isSemVerShaped` now uses the official regex from semver.org (with an added optional leading `v` for Helm tags) instead of the hand-rolled one.

Added tests for the listing fast-path, the fallback, and a non-listing response; full suite is green (`npm test`, `typecheck`, `format-check`).
2026-07-20 15:27:29 -04:00
Ogheneobukome EjaifeandGitHub eb399fcd4f fix: preserve subpath base URLs in getHelmDownloadURL (#292)
Ensure downloadBaseURL ends with '/' before URL resolution so a subpath
mirror (e.g. https://example/kubernetes/helm) is preserved instead of having
its last path segment replaced. Fixes downloads for all subpath mirrors.
2026-07-15 12:45:05 -07:00
somazandGitHub 017211e1b1 Add version-file input to read the Helm version from a .tool-versions file (#281)
* feat: add version-file input to read helm version from .tool-versions

* feat: validate semver shape of helm version from .tool-versions
2026-06-23 13:07:39 -07:00
69214f9d74 fix: use chmod 755 instead of 777 for downloaded helm binary and folder (#278)
World-writable permissions allow other processes on shared runners to replace the helm binary or inject files between download and execution.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-05 11:25:36 +12:00
David GameroandGitHub 3090233644 Fix TypeScript 6.0 compatibility errors in run.ts (#271) 2026-05-05 11:18:11 -07:00
David GameroandGitHub 1e2e44e1bc Migrate to ESM with esbuild/vitest and upgrade to node24 (#260)
- Add "type": "module" to package.json for ESM support
- Replace ncc with esbuild for bundling (with createRequire banner for CJS compat)
- Replace jest/ts-jest with vitest for testing
- Upgrade @actions/core to ^3.0.0, @actions/exec to ^3.0.0, @actions/io to ^3.0.2, @actions/tool-cache to 4.0.0 (ESM-only versions)
- Update tsconfig.json to use NodeNext module resolution
- Convert all tests to use vi.mock() factory pattern for ESM-only module compatibility
- Update action.yml runtime from node20 to node24
- Bump version from 4.3.1 to 5.0.0 (major version bump for breaking node runtime change)
2026-03-24 10:46:19 -07:00
Tatsat (Tats) Mishra 🐉andGitHub 95eab887c3 Fix build error. (#225)
Signed-off-by: Tatsat Mishra <tamishra@microsoft.com>
2025-11-18 11:07:39 -08:00
Suneha BoseandGitHub 5e7287287e ci(workflows): update helm version to v3.18.4 and add matrix for tests (#207) 2025-08-12 15:18:06 -04:00
fb8fa40706 Update default helm version to 3.18.3 (#194)
* Update default helm version to 3.18.3

* Update default version everywhere

---------

Co-authored-by: Suneha Bose <123775811+bosesuneha@users.noreply.github.com>
2025-08-06 17:29:05 -04:00
Cornelius RoemerandGitHub 32bc12022d chore(tests): Mock arch to make tests pass on arm host (#191)
Also add Windows arm64 download link test now that arm64 runners exist for Windows.
2025-08-06 12:44:51 -07:00
TatsinnitandGitHub 28f285563b Fix types, and update node version. (#181)
* Fix types, and update node version.

Signed-off-by: Tatsat Mishra <tamishra@microsoft.com>

* Prettier Fix for this repo.

Signed-off-by: Tatsat Mishra <tamishra@microsoft.com>

---------

Signed-off-by: Tatsat Mishra <tamishra@microsoft.com>
2025-05-13 15:19:00 -04:00
Peter DownsandGitHub b48e1dfac1 feat: log when restoring from cache (#152)
* feat: log when restoring from cache

* undo semicolon change
2025-02-14 14:39:40 -08:00
Jaiveer KatariyaandGitHub 124c6d88e7 Dependencies Update (#157) 2025-01-31 09:28:08 -08:00
Dmytro BondarandGitHub 0a0c55a4c3 Fix os detection and archive extension (#124) 2024-04-12 15:46:47 -04:00
elProxyandGitHub ec8dd7c209 switching to fetching latest version from the dedicated file (#130) 2024-03-01 10:15:56 -06:00
Dmytro BondarandGitHub 208de6bd49 Upgrade action to use node20 (#121)
* Action update:

- Bump all dependencies
- Rewrite `getLatestHelmVersion()` function without graphql

* Bump stableHelmVersion

* Update readme and action.yaml

* Revert and rewrite with @octokit/action

* Add latest to integration test

* Bump action's versions

* Set github.token as default input

* Replace deprecated jest methods

* Add prettier to dev dependencies, fix prettier issues
2024-02-08 13:49:56 -05:00
d336b89352 Add action input to set download base url (#113)
* feat: add downloadBaseURL action input

* feat: downloadHelm and getHelmDownloadURL added baseURL function argument

* refactor: building the helm download url

* chore: format code

---------

Co-authored-by: Paul Vollmer <mail@paulvollmer.net>
2024-01-02 09:30:48 -05:00
TekoandGitHub ac5ee1fca8 Update helm to v3.11.1 (#108) 2023-02-16 19:41:09 -05:00
Ajay KemparajandGitHub f77071b246 minor nit , upgrade helm and GH action version updates (#102) 2022-12-27 09:28:27 -05:00
Joe PreviteandGitHub 2dafda840c refactor: cleanup GH gql query (#100) 2022-10-27 09:44:25 -04:00
Oliver KingandGitHub f850d12cb3 Fix [object Object] version bug (#88)
* fix auth

* fix tag bug
2022-07-25 13:53:22 -04:00
Oliver KingandGitHub 17cd77473c fix auth (#86) 2022-07-25 13:13:50 -04:00
Oliver KingandGitHub 484a64052d Swap to GraphQL and add logging (#83)
* swap to graphql

* add logs

* swap to group log

* fix test
2022-07-11 10:12:11 -04:00
7f0153c54c Vidya reddy prettier (#75)
* upgraded to Node16

* Enforce Prettier

* code fix

* Update package-lock.json

resolved the conflicts.

* executed prettier

Co-authored-by: Vidya Reddy <vidyareddy@microsoft.com>
2022-06-27 18:27:44 -04:00
Asa GayleandGitHub e00756a00e Version fix (#66)
* Added version validation check

* Added check for latest

* Changed Helm 3.5.0 test to also test lack of v in version

* Pushing integration tests

* Removed push integration test

* Added more context to integration test

* Addressing comment
2022-02-08 17:07:21 -05:00
Oliver KingandGitHub 5876560d6c Add arm64 support (#64)
* add arm64 support
2022-02-04 09:45:03 -05:00
Asa GayleandGitHub cc2c85bd7e support only v3 and switch away from github token 2022-01-26 15:27:11 -05:00
SundarandGitHub 14d85694fc Update run.ts 2021-06-24 19:26:50 +05:30
SundarandGitHub cfc72cf63e Update run.ts 2021-06-24 19:25:35 +05:30
shigupt202andGitHub edc063ca5f adding graph ql for Helm versions - master (#22)
* Adding graphql to find out latest helm version of specified type

* Updating package-loc.json

* Updating js file

* Fixing PR comments

* Adding feature flag as environment variable

* Changing feature flag name

* Updating package-loc.json
2021-03-30 22:43:44 +05:30
SundarandGitHub e77e49c8f8 Added L0 tests and fixed some minor issues. (#20) 2021-03-26 13:08:55 +05:30
rgsubhandGitHub 91b7d21636 Changed the documentation to specify v before 'version' and code changes to append 'v' if it not provided in version (#11) (#15)
* Chnaged the documentation to sepcify v before 'version'

* append v to version incase it does not already include

* review comments fix
2020-05-14 12:16:24 +05:30
shigupt202andGitHub b1c4524a5f Users/shigupt/fixing helm latest releases master (#14)
* Updating the logic for downloading latest Helm version

* Adding semver to package.json
2020-05-13 21:53:04 +05:30
Anumita Shenoy fe2c706cad Added helm binary to the Path environment variable 2019-11-26 17:55:31 +05:30
Anumita Shenoy 785a9d3ba2 Added exception for helm-path 2019-10-15 13:33:32 +05:30
Anumita Shenoy 0c30698f96 Added compliance details 2019-10-11 16:24:26 +05:30
Anumita Shenoy 8552a6edfe Added setup-helm : Install helm binary 2019-10-04 12:16:40 +05:30