Compare commits

...

10 Commits

Author SHA1 Message Date
GitHub Action
1a275c3b69 build 2025-08-19 20:52:26 +00:00
Suneha Bose
9e7f762d6f chore(release): v4.3.1 (#208)
* chore(release): v4.3.1

* bump version to 4.3.1 in package files

* add 'Changed' section

* docs(changelog): move 'Add pre-commit hook' to Added section
2025-08-19 16:51:40 -04:00
dependabot[bot]
c096176d63 Bump @types/node from 24.1.0 to 24.2.1 in the actions group (#206)
Bumps the actions group with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 24.1.0 to 24.2.1
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 24.2.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 15:20:26 -04:00
Suneha Bose
5e7287287e ci(workflows): update helm version to v3.18.4 and add matrix for tests (#207) 2025-08-12 15:18:06 -04:00
Cornelius Roemer
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 Roemer
0d097290a8 chore: remove unnecessary prebuild script (#192)
`@vercel/ncc` is already specified in dev dependencies, so `npm i` installs it. There's no need for a separate `npm i ncc`.

Running the prebuild script also adds a dependency, which is definitely not desired.
2025-08-06 12:45:24 -07:00
Cornelius Roemer
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
dependabot[bot]
51463d68e8 Bump the actions group with 2 updates (#205)
Bumps the actions group with 2 updates: [ts-jest](https://github.com/kulshekhar/ts-jest) and [typescript](https://github.com/microsoft/TypeScript).


Updates `ts-jest` from 29.4.0 to 29.4.1
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.4.0...v29.4.1)

Updates `typescript` from 5.8.3 to 5.9.2
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.8.3...v5.9.2)

---
updated-dependencies:
- dependency-name: ts-jest
  dependency-version: 29.4.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: typescript
  dependency-version: 5.9.2
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-05 12:08:23 -07:00
dependabot[bot]
aff10941b2 Bump the actions group across 1 directory with 2 updates (#204)
Bumps the actions group with 2 updates in the / directory: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) and [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest).


Updates `@types/node` from 24.0.13 to 24.1.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `jest` from 30.0.4 to 30.0.5
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.0.5/packages/jest)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 24.1.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: jest
  dependency-version: 30.0.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-29 12:12:22 -07:00
David Gamero
a10a5247d8 Update helm version retrieval to use JSON output for latest version (#203)
* Update helm version retrieval to use JSON output for latest version

* Fix helm latest version retrieval command syntax
2025-07-23 11:07:31 -04:00
10 changed files with 30995 additions and 523 deletions

View File

@@ -7,11 +7,19 @@ on:
jobs:
trigger-integration-tests:
name: Trigger Integration tests
runs-on: ubuntu-latest
strategy:
matrix:
os:
- ubuntu-latest
- ubuntu-24.04-arm
- macos-latest # arm
- macos-13 # x64
fail-fast: false
runs-on: ${{ matrix.os }}
env:
HELM_3_8_0: 'v3.8.0'
HELM_3_7_2: 'v3.7.2'
HELM_NO_V: '3.5.0'
HELM_3_18_4: 'v3.18.4'
HELM_3_18_0: 'v3.18.0'
HELM_NO_V: '3.18.4'
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
steps:
- name: Check out repository
@@ -27,41 +35,41 @@ jobs:
- name: Setup helm
uses: ./
with:
version: ${{ env.HELM_3_8_0 }}
- name: Validate helm 3.8.0
version: ${{ env.HELM_3_18_4 }}
- name: Validate helm 3.18.4
run: |
if [[ $(helm version) != *$HELM_3_8_0* ]]; then
echo "HELM VERSION INCORRECT: HELM VERSION DOES NOT CONTAIN v3.8.0"
if [[ $(helm version) != *$HELM_3_18_4* ]]; then
echo "HELM VERSION INCORRECT: HELM VERSION DOES NOT CONTAIN v3.18.4"
echo "HELM VERSION OUTPUT: $(helm version)"
exit 1
else
echo "HELM VERSION $HELM_3_8_0 INSTALLED SUCCESSFULLY"
echo "HELM VERSION $HELM_3_18_4 INSTALLED SUCCESSFULLY"
fi
- name: Setup helm 3.7.2
- name: Setup helm 3.18.0
uses: ./
with:
version: ${{ env.HELM_3_7_2 }}
- name: Validate 3.7.2
version: ${{ env.HELM_3_18_0 }}
- name: Validate 3.18.0
run: |
if [[ $(helm version) != *$HELM_3_7_2* ]]; then
echo "HELM VERSION INCORRECT: HELM VERSION DOES NOT CONTAIN v3.7.2"
if [[ $(helm version) != *$HELM_3_18_0* ]]; then
echo "HELM VERSION INCORRECT: HELM VERSION DOES NOT CONTAIN v3.18.0"
echo "HELM VERSION OUTPUT: $(helm version)"
exit 1
else
echo "HELM VERSION $HELM_3_7_2 INSTALLED SUCCESSFULLY"
echo "HELM VERSION $HELM_3_18_0 INSTALLED SUCCESSFULLY"
fi
- name: Setup helm 3.5.0 with no v in version
- name: Setup helm 3.18.4 with no v in version
uses: ./
with:
version: ${{ env.HELM_NO_V }}
- name: Validate 3.5.0 without v in version
- name: Validate 3.18.4 without v in version
run: |
if [[ $(helm version) != *$HELM_NO_V* ]]; then
echo "HELM VERSION INCORRECT: HELM VERSION DOES NOT CONTAIN v3.5.0"
echo "HELM VERSION INCORRECT: HELM VERSION DOES NOT CONTAIN 3.18.4"
echo "HELM VERSION OUTPUT: $(helm version)"
exit 1
else
echo "HELM VERSION $HELM_3_5_0 INSTALLED SUCCESSFULLY"
echo "HELM VERSION $HELM_NO_V INSTALLED SUCCESSFULLY"
fi
- name: Setup helm latest version
uses: ./
@@ -76,7 +84,8 @@ jobs:
--repo helm/helm \
--exclude-drafts \
--exclude-pre-releases \
--limit 1 | awk '{print $4}')
--json name,isLatest \
--jq '.[] | select(.isLatest)|.name' | awk '{print $2}')
if [[ $(helm version) != *$HELM_LATEST* ]]; then
echo "HELM VERSION INCORRECT: HELM VERSION DOES NOT CONTAIN $HELM_LATEST"

View File

@@ -11,7 +11,17 @@ on: # rebuild any PRs and main branch changes
jobs:
build: # make sure build/ci works properly
runs-on: ubuntu-latest
strategy:
matrix:
os:
- ubuntu-latest
- ubuntu-24.04-arm
- windows-latest
- windows-11-arm
- macos-latest # arm
- macos-13 # x64
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

3
.gitignore vendored
View File

@@ -11,8 +11,6 @@ pids
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
@@ -64,4 +62,3 @@ node_modules
coverage
# Transpiled JS
lib/

View File

@@ -1,5 +1,20 @@
# Change Log
## [4.3.1] - 2025-08-12
### Changed
- #167 [Pinning Action Dependencies for Security and Reliability](https://github.com/Azure/setup-helm/pull/167)
- #181 [Fix types, and update node version.](https://github.com/Azure/setup-helm/pull/181)
- #191 [chore(tests): Mock arch to make tests pass on arm host](https://github.com/Azure/setup-helm/pull/191)
- #192 [chore: remove unnecessary prebuild script](https://github.com/Azure/setup-helm/pull/192)
- #203 [Update helm version retrieval to use JSON output for latest version](https://github.com/Azure/setup-helm/pull/203)
- #207 [ci(workflows): update helm version to v3.18.4 and add matrix for tests](https://github.com/Azure/setup-helm/pull/207)
### Added
- #197 [Add pre-commit hook](https://github.com/Azure/setup-helm/pull/197)
## [4.3.0] - 2025-02-15
- #152 feat: log when restoring from cache

View File

@@ -14,7 +14,7 @@ Acceptable values are latest or any semantic version string like v3.5.0 Use this
```
> [!NOTE]
> If something goes wrong with fetching the latest version the action will use the hardcoded default stable version (currently v3.13.3). If you rely on a certain version higher than the default, you should explicitly use that version instead of latest.
> If something goes wrong with fetching the latest version the action will use the hardcoded default version (currently v3.18.3). If you rely on a certain version higher than the default, you should explicitly use 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

30268
lib/index.js Normal file

File diff suppressed because one or more lines are too long

1139
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "setuphelm",
"version": "4.3.0",
"version": "4.3.1",
"private": true,
"description": "Setup helm",
"author": "Anumita Shenoy",
@@ -15,7 +15,6 @@
},
"main": "lib/index.js",
"scripts": {
"prebuild": "npm i ncc",
"build": "ncc build src/index.ts -o lib",
"test": "jest",
"test-coverage": "jest --coverage",
@@ -25,12 +24,12 @@
},
"devDependencies": {
"@types/jest": "^30.0.0",
"@types/node": "^24.0.13",
"@types/node": "^24.2.1",
"@vercel/ncc": "^0.38.3",
"husky": "^9.1.7",
"jest": "^30.0.4",
"jest": "^30.0.5",
"prettier": "^3.6.2",
"ts-jest": "^29.4.0",
"typescript": "^5.8.3"
"ts-jest": "^29.4.1",
"typescript": "^5.9.2"
}
}

View File

@@ -67,7 +67,7 @@ describe('run.ts', () => {
expect(os.arch).toHaveBeenCalled()
})
test('getHelmDownloadURL() - return the URL to download helm for Windows', () => {
test('getHelmDownloadURL() - return the URL to download helm for Windows x64', () => {
jest.spyOn(os, 'platform').mockReturnValue('win32')
jest.spyOn(os, 'arch').mockReturnValue('x64')
@@ -76,6 +76,15 @@ describe('run.ts', () => {
expect(os.platform).toHaveBeenCalled()
})
test('getHelmDownloadURL() - return the URL to download helm for Windows arm64', () => {
jest.spyOn(os, 'platform').mockReturnValue('win32')
jest.spyOn(os, 'arch').mockReturnValue('arm64')
const expected = 'https://test.tld/helm-v3.8.0-windows-arm64.zip'
expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe(expected)
expect(os.platform).toHaveBeenCalled()
})
test('getLatestHelmVersion() - return the latest version of HELM', async () => {
const res = {
status: 200,
@@ -88,7 +97,7 @@ describe('run.ts', () => {
test('getLatestHelmVersion() - return the stable version of HELM when simulating a network error', async () => {
const errorMessage: string = 'Network Error'
global.fetch = jest.fn().mockRejectedValueOnce(new Error(errorMessage))
expect(await run.getLatestHelmVersion()).toBe('v3.13.3')
expect(await run.getLatestHelmVersion()).toBe(run.stableHelmVersion)
})
test('getValidVersion() - return version with v prepended', () => {
@@ -204,6 +213,7 @@ describe('run.ts', () => {
const response = JSON.stringify([{tag_name: 'v4.0.0'}])
jest.spyOn(fs, 'readFileSync').mockReturnValue(response)
jest.spyOn(os, 'platform').mockReturnValue('win32')
jest.spyOn(os, 'arch').mockReturnValue('x64')
jest.spyOn(fs, 'chmodSync').mockImplementation(() => {})
jest.spyOn(toolCache, 'extractZip').mockResolvedValue('extractedPath')
jest.spyOn(toolCache, 'cacheDir').mockResolvedValue('pathToCachedDir')
@@ -239,6 +249,7 @@ describe('run.ts', () => {
throw 'Unable to download'
})
jest.spyOn(os, 'platform').mockReturnValue('win32')
jest.spyOn(os, 'arch').mockReturnValue('x64')
const downloadUrl = 'https://test.tld/helm-v3.2.1-windows-amd64.zip'
await expect(run.downloadHelm(downloadBaseURL, 'v3.2.1')).rejects.toThrow(
@@ -254,6 +265,7 @@ describe('run.ts', () => {
jest.spyOn(toolCache, 'downloadTool').mockResolvedValue('pathToTool')
jest.spyOn(toolCache, 'extractZip').mockResolvedValue('extractedPath')
jest.spyOn(os, 'platform').mockReturnValue('win32')
jest.spyOn(os, 'arch').mockReturnValue('x64')
jest.spyOn(fs, 'chmodSync').mockImplementation(() => {})
jest
.spyOn(fs, 'readdirSync')
@@ -283,6 +295,7 @@ describe('run.ts', () => {
jest.spyOn(toolCache, 'downloadTool').mockResolvedValue('pathToTool')
jest.spyOn(toolCache, 'extractZip').mockResolvedValue('extractedPath')
jest.spyOn(os, 'platform').mockReturnValue('win32')
jest.spyOn(os, 'arch').mockReturnValue('x64')
jest.spyOn(fs, 'chmodSync').mockImplementation()
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => [])
jest.spyOn(fs, 'statSync').mockImplementation((file) => {

View File

@@ -10,7 +10,7 @@ import * as toolCache from '@actions/tool-cache'
import * as core from '@actions/core'
const helmToolName = 'helm'
const stableHelmVersion = 'v3.13.3'
export const stableHelmVersion = 'v3.18.4'
export async function run() {
let version = core.getInput('version', {required: true})