Compare commits

..

35 Commits
v4.1.0 ... main

Author SHA1 Message Date
0147554077 Bump the actions group with 2 updates (#199)
Bumps the actions group with 2 updates: [@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.7 to 24.0.10
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `jest` from 30.0.3 to 30.0.4
- [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.4/packages/jest)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 24.0.10
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: jest
  dependency-version: 30.0.4
  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-08 15:21:35 -04:00
4eee2cd0ed Add pre-commit hook (#197) 2025-07-03 09:53:58 +12:00
8527f3ee39 Bump the actions group with 3 updates (#198)
Bumps the actions group with 3 updates: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node), [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest) and [prettier](https://github.com/prettier/prettier).


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

Updates `jest` from 30.0.2 to 30.0.3
- [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.3/packages/jest)

Updates `prettier` from 3.6.0 to 3.6.2
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.6.0...3.6.2)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 24.0.7
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: jest
  dependency-version: 30.0.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: prettier
  dependency-version: 3.6.2
  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-01 15:13:29 -04:00
c9a6a97d7f Bump Azure/action-release-workflows (#196) 2025-06-24 12:10:20 -07:00
027e8cdfd7 Bump the actions group with 3 updates (#195) 2025-06-24 12:08:32 -07:00
df342a2656 Bump the actions group with 4 updates (#186) 2025-06-17 15:14:55 -04:00
230641be01 Bump @types/node from 22.15.29 to 22.15.30 in the actions group (#185) 2025-06-10 15:05:34 -04:00
f57bbf1821 Bump the actions group with 2 updates (#183) 2025-06-03 10:26:17 -04:00
5b950139b7 Bump the actions group with 3 updates (#182) 2025-05-20 15:12:51 -04:00
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
d030d7f717 Bump @types/node from 22.15.3 to 22.15.17 in the actions group (#180) 2025-05-13 12:13:45 -07:00
05502a08f2 Bump @types/node from 22.14.1 to 22.15.3 in the actions group (#179) 2025-04-29 15:10:13 -04:00
24eca957cf Bump the actions group with 3 updates (#178) 2025-04-15 15:08:19 -04:00
56195efbb1 Bump the actions group with 3 updates (#176) 2025-04-08 15:06:45 -04:00
babfb8676f Bump @types/node from 22.13.12 to 22.13.14 in the actions group (#175) 2025-04-01 15:07:47 -04:00
c757a812df Bump the actions group with 2 updates (#174)
Bumps the actions group with 2 updates: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) and [ts-jest](https://github.com/kulshekhar/ts-jest).


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

Updates `ts-jest` from 29.2.6 to 29.3.0
- [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.2.6...v29.3.0)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: ts-jest
  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-03-25 15:11:41 -04:00
d5f1fcb584 Bump Azure/action-release-workflows (#170)
Bumps the actions group in /.github/workflows with 1 update: [Azure/action-release-workflows](https://github.com/azure/action-release-workflows).


Updates `Azure/action-release-workflows` from 1.0.1 to 1.0.2
- [Release notes](https://github.com/azure/action-release-workflows/releases)
- [Changelog](https://github.com/Azure/action-release-workflows/blob/main/CHANGELOG.md)
- [Commits](6f9de5deea...1b199cc979)

---
updated-dependencies:
- dependency-name: Azure/action-release-workflows
  dependency-type: direct:production
  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-03-13 14:18:56 -04:00
cc690771a5 Bump undici from 5.28.4 to 5.28.5 (#173)
Bumps [undici](https://github.com/nodejs/undici) from 5.28.4 to 5.28.5.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.4...v5.28.5)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-13 14:14:13 -04:00
c4cd5ccdf7 Bump the actions group across 1 directory with 5 updates (#172)
Bumps the actions group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@octokit/action](https://github.com/octokit/action.js) | `7.0.0` | `7.0.1` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `22.13.1` | `22.13.10` |
| [prettier](https://github.com/prettier/prettier) | `3.5.0` | `3.5.3` |
| [ts-jest](https://github.com/kulshekhar/ts-jest) | `29.2.5` | `29.2.6` |
| [typescript](https://github.com/microsoft/TypeScript) | `5.7.3` | `5.8.2` |



Updates `@octokit/action` from 7.0.0 to 7.0.1
- [Release notes](https://github.com/octokit/action.js/releases)
- [Commits](https://github.com/octokit/action.js/compare/v7.0.0...v7.0.1)

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

Updates `prettier` from 3.5.0 to 3.5.3
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.5.0...3.5.3)

Updates `ts-jest` from 29.2.5 to 29.2.6
- [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.2.5...v29.2.6)

Updates `typescript` from 5.7.3 to 5.8.2
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.7.3...v5.8.2)

---
updated-dependencies:
- dependency-name: "@octokit/action"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: ts-jest
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: typescript
  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-03-11 11:54:28 +13:00
740f020522 Bump @octokit/endpoint from 10.1.1 to 10.1.3 (#160)
Bumps [@octokit/endpoint](https://github.com/octokit/endpoint.js) from 10.1.1 to 10.1.3.
- [Release notes](https://github.com/octokit/endpoint.js/releases)
- [Commits](https://github.com/octokit/endpoint.js/compare/v10.1.1...v10.1.3)

---
updated-dependencies:
- dependency-name: "@octokit/endpoint"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-10 18:50:51 -04:00
5976fc8a1b Pinning Action Dependencies for Security and Reliability (#167)
* Pinning Dependencies

* actionx/prettier sha
2025-02-28 13:28:29 -08:00
0e8654bb94 Release setup-helm version 4.3.0 (#162) 2025-02-17 22:54:56 -08:00
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
855ae7a03c Bump the actions group across 1 directory with 3 updates (#159) 2025-02-13 09:16:24 +13:00
124c6d88e7 Dependencies Update (#157) 2025-01-31 09:28:08 -08:00
048f4e7eae Bump the actions group across 1 directory with 2 updates (#151)
Bumps the actions group with 2 updates in the / directory: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) and [prettier](https://github.com/prettier/prettier).


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

Updates `prettier` from 3.4.1 to 3.4.2
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.4.1...3.4.2)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: prettier
  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>
2024-12-18 15:24:59 -05:00
8618769467 Bump the actions group across 1 directory with 4 updates (#149)
Bumps the actions group with 4 updates in the / directory: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node), [@vercel/ncc](https://github.com/vercel/ncc), [prettier](https://github.com/prettier/prettier) and [typescript](https://github.com/microsoft/TypeScript).


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

Updates `@vercel/ncc` from 0.38.2 to 0.38.3
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.38.2...0.38.3)

Updates `prettier` from 3.3.3 to 3.4.1
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.3.3...3.4.1)

Updates `typescript` from 5.6.3 to 5.7.2
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.6.3...v5.7.2)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: typescript
  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>
2024-12-04 15:12:06 -05:00
4eb898eef0 Bump the actions group across 1 directory with 2 updates (#145)
Bumps the actions group with 2 updates in the / directory: [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) and [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


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

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

---
updated-dependencies:
- dependency-name: "@types/jest"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: "@types/node"
  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>
2024-11-06 15:10:39 -05:00
7a2001c0f6 Bump the actions group across 1 directory with 2 updates (#143) 2024-10-23 12:19:17 -07:00
e90c86ceea Bump the actions group across 1 directory with 9 updates (#141)
Bumps the actions group with 9 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) | `1.10.1` | `1.11.1` |
| [@octokit/action](https://github.com/octokit/action.js) | `6.0.7` | `7.0.0` |
| [semver](https://github.com/npm/node-semver) | `7.5.4` | `7.6.3` |
| [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) | `29.5.11` | `29.5.13` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `20.11.8` | `22.7.4` |
| [@vercel/ncc](https://github.com/vercel/ncc) | `0.38.1` | `0.38.2` |
| [prettier](https://github.com/prettier/prettier) | `3.2.5` | `3.3.3` |
| [ts-jest](https://github.com/kulshekhar/ts-jest) | `29.1.2` | `29.2.5` |
| [typescript](https://github.com/microsoft/TypeScript) | `5.3.3` | `5.6.2` |



Updates `@actions/core` from 1.10.1 to 1.11.1
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Updates `@octokit/action` from 6.0.7 to 7.0.0
- [Release notes](https://github.com/octokit/action.js/releases)
- [Commits](https://github.com/octokit/action.js/compare/v6.0.7...v7.0.0)

Updates `semver` from 7.5.4 to 7.6.3
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.5.4...v7.6.3)

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

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

Updates `@vercel/ncc` from 0.38.1 to 0.38.2
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.38.1...0.38.2)

Updates `prettier` from 3.2.5 to 3.3.3
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.2.5...3.3.3)

Updates `ts-jest` from 29.1.2 to 29.2.5
- [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.1.2...v29.2.5)

Updates `typescript` from 5.3.3 to 5.6.2
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.3.3...v5.6.2)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: "@octokit/action"
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: semver
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: "@types/jest"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: ts-jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: typescript
  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>
2024-10-08 16:39:27 -04:00
4675ea6b05 Add dependabot (#137) 2024-09-05 19:36:08 -07:00
df50d879fa Release v4.2.0 (#134)
* Update CHANGELOG.md

* Update package.json

* Update README.md
2024-04-15 15:41:59 -04:00
08d7123a4a Bump undici from 5.28.2 to 5.28.4 (#133)
Bumps [undici](https://github.com/nodejs/undici) from 5.28.2 to 5.28.4.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.2...v5.28.4)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-12 16:23:04 -04:00
0a0c55a4c3 Fix os detection and archive extension (#124) 2024-04-12 15:46:47 -04:00
d00ce1cb5e update to release workflow major version tag (#132) 2024-03-08 13:33:11 -05:00
19 changed files with 2266 additions and 32231 deletions

18
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
groups:
actions:
patterns:
- '*'
- package-ecosystem: github-actions
directory: .github/workflows
schedule:
interval: weekly
groups:
actions:
patterns:
- '*'

View File

@ -13,7 +13,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/stale@v9
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 #v9.1.0
name: Setting issue as idle
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
@ -24,7 +24,7 @@ jobs:
operations-per-run: 100
exempt-issue-labels: 'backlog'
- uses: actions/stale@v9
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 #v9.1.0
name: Setting PR as idle
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -15,7 +15,7 @@ jobs:
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: npm install and build
id: action-npm-build
run: |

View File

@ -10,9 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Enforce Prettier
uses: actionsx/prettier@v3
with:
args: --check .
run: npx prettier --check .

View File

@ -13,6 +13,6 @@ jobs:
permissions:
actions: read
contents: write
uses: Azure/action-release-workflows/.github/workflows/release_js_project.yaml@a705b2ab6a3ee889f2b0d925ad0bd2f9eb733ce6
uses: Azure/action-release-workflows/.github/workflows/release_js_project.yaml@3c677ba5ab58f5c5c1a6f0cfb176b333b1f27405 # v1.0.3
with:
changelogPath: ./CHANGELOG.md

View File

@ -7,4 +7,4 @@ on:
jobs:
tag-and-release:
uses: OliverMKing/javascript-release-workflow/.github/workflows/tag-and-release.yml@main
uses: OliverMKing/javascript-release-workflow/.github/workflows/tag-and-release.yml@c753e1545b144562237cd1177a95bab21a785cff # main

View File

@ -13,7 +13,7 @@ jobs:
build: # make sure build/ci works properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Run L0 tests.
run: |

3
.gitignore vendored
View File

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

7
.husky/pre-commit Normal file
View File

@ -0,0 +1,7 @@
npm test
npm run format-check || {
echo ""
echo "❌ Formatting check failed."
echo "đź’ˇ Run 'npm run format' or 'prettier --write .' to fix formatting issues."
exit 1
}

View File

@ -1,9 +1,19 @@
# Change Log
## [4.3.0] - 2025-02-15
- #152 feat: log when restoring from cache
- #157 Dependencies Update
- #137 Add dependabot
## [4.2.0] - 2024-04-15
- #124 Fix OS detection and download OS-native archive extension
## [4.1.0] - 2024-03-01
- #130 switches to use Helm published file to read latest version instead of using GitHub releases
- #130 switches to use Helm published file to read latest version instead of using GitHub releases
## [4.0.0] - 2024-02-12
- #121 update to node20 as node16 is deprecated
- #121 update to node20 as node16 is deprecated

View File

@ -4,6 +4,6 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
Resources:
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns

View File

@ -7,7 +7,7 @@ Install a specific version of helm binary on the runner.
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.
```yaml
- uses: azure/setup-helm@v4.1.0
- uses: azure/setup-helm@v4.3.0
with:
version: '<version>' # default is latest (stable)
id: install

View File

@ -18,13 +18,13 @@ You should receive a response within 24 hours. If for some reason you do not, pl
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
- Full paths of source file(s) related to the manifestation of the issue
- The location of the affected source code (tag/branch/commit or direct URL)
- Any special configuration required to reproduce the issue
- Step-by-step instructions to reproduce the issue
- Proof-of-concept or exploit code (if possible)
- Impact of the issue, including how an attacker might exploit the issue
- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
- Full paths of source file(s) related to the manifestation of the issue
- The location of the affected source code (tag/branch/commit or direct URL)
- Any special configuration required to reproduce the issue
- Step-by-step instructions to reproduce the issue
- Proof-of-concept or exploit code (if possible)
- Impact of the issue, including how an attacker might exploit the issue
This information will help us triage your report more quickly.

30640
lib/index.js

File diff suppressed because one or more lines are too long

3467
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +1,36 @@
{
"name": "setuphelm",
"version": "4.1.0",
"version": "4.3.0",
"private": true,
"description": "Setup helm",
"author": "Anumita Shenoy",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2",
"@actions/tool-cache": "2.0.1",
"@octokit/action": "^6.0.7",
"ncc": "^0.3.6",
"semver": "^7.5.4"
"@actions/tool-cache": "2.0.2",
"@octokit/action": "^8.0.2",
"semver": "^7.7.2"
},
"main": "lib/index.js",
"scripts": {
"prebuild": "npm i ncc",
"build": "ncc build src/run.ts -o lib",
"build": "ncc build src/index.ts -o lib",
"test": "jest",
"test-coverage": "jest --coverage",
"format": "prettier --write .",
"format-check": "prettier --check ."
"format-check": "prettier --check .",
"prepare": "husky"
},
"devDependencies": {
"@types/jest": "^29.5.11",
"@types/node": "^20.11.8",
"@vercel/ncc": "^0.38.1",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"ts-jest": "^29.1.2",
"typescript": "^5.3.3"
"@types/jest": "^30.0.0",
"@types/node": "^24.0.10",
"@vercel/ncc": "^0.38.3",
"husky": "^9.1.7",
"jest": "^30.0.4",
"prettier": "^3.6.2",
"ts-jest": "^29.4.0",
"typescript": "^5.8.3"
}
}

4
src/index.ts Normal file
View File

@ -0,0 +1,4 @@
import {run} from './run'
import * as core from '@actions/core'
run().catch(core.setFailed)

View File

@ -6,84 +6,74 @@ import * as path from 'path'
import * as core from '@actions/core'
describe('run.ts', () => {
const downloadBaseURL = 'https://test.tld'
// Cleanup mocks after each test to ensure that subsequent tests are not affected by the mocks.
afterEach(() => {
jest.restoreAllMocks()
})
test('getExecutableExtension() - return .exe when os is Windows', () => {
jest.spyOn(os, 'type').mockReturnValue('Windows_NT')
jest.spyOn(os, 'platform').mockReturnValue('win32')
expect(run.getExecutableExtension()).toBe('.exe')
expect(os.type).toHaveBeenCalled()
expect(os.platform).toHaveBeenCalled()
})
test('getExecutableExtension() - return empty string for non-windows OS', () => {
jest.spyOn(os, 'type').mockReturnValue('Darwin')
jest.spyOn(os, 'platform').mockReturnValue('darwin')
expect(run.getExecutableExtension()).toBe('')
expect(os.type).toHaveBeenCalled()
expect(os.platform).toHaveBeenCalled()
})
test('getHelmDownloadURL() - return the URL to download helm for Linux', () => {
const downloadBaseURL = 'https://test.tld'
test('getHelmDownloadURL() - return the URL to download helm for Linux amd64', () => {
jest.spyOn(os, 'platform').mockReturnValue('linux')
jest.spyOn(os, 'arch').mockReturnValue('x64')
const expected = 'https://test.tld/helm-v3.8.0-linux-amd64.tar.gz'
jest.spyOn(os, 'type').mockReturnValue('Linux')
jest.spyOn(os, 'arch').mockReturnValueOnce('unknown')
const helmLinuxUrl = 'https://test.tld/helm-v3.8.0-linux-amd64.zip'
expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe(
helmLinuxUrl
)
expect(os.type).toHaveBeenCalled()
expect(os.arch).toHaveBeenCalled()
// arm64
jest.spyOn(os, 'type').mockReturnValue('Linux')
jest.spyOn(os, 'arch').mockReturnValueOnce('arm64')
const helmLinuxArm64Url = 'https://test.tld/helm-v3.8.0-linux-arm64.zip'
expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe(
helmLinuxArm64Url
)
expect(os.type).toHaveBeenCalled()
expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe(expected)
expect(os.platform).toHaveBeenCalled()
expect(os.arch).toHaveBeenCalled()
})
test('getHelmDownloadURL() - return the URL to download helm for Darwin', () => {
const downloadBaseURL = 'https://test.tld'
test('getHelmDownloadURL() - return the URL to download helm for Linux arm64', () => {
jest.spyOn(os, 'platform').mockReturnValue('linux')
jest.spyOn(os, 'arch').mockReturnValue('arm64')
const expected = 'https://test.tld/helm-v3.8.0-linux-arm64.tar.gz'
jest.spyOn(os, 'type').mockReturnValue('Darwin')
jest.spyOn(os, 'arch').mockReturnValueOnce('unknown')
const helmDarwinUrl = 'https://test.tld/helm-v3.8.0-darwin-amd64.zip'
expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe(
helmDarwinUrl
)
expect(os.type).toHaveBeenCalled()
expect(os.arch).toHaveBeenCalled()
// arm64
jest.spyOn(os, 'type').mockReturnValue('Darwin')
jest.spyOn(os, 'arch').mockReturnValueOnce('arm64')
const helmDarwinArm64Url = 'https://test.tld/helm-v3.8.0-darwin-arm64.zip'
expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe(
helmDarwinArm64Url
)
expect(os.type).toHaveBeenCalled()
expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe(expected)
expect(os.platform).toHaveBeenCalled()
expect(os.arch).toHaveBeenCalled()
})
test('getValidVersion() - return version with v prepended', () => {
expect(run.getValidVersion('3.8.0')).toBe('v3.8.0')
test('getHelmDownloadURL() - return the URL to download helm for Darwin x64', () => {
jest.spyOn(os, 'platform').mockReturnValue('darwin')
jest.spyOn(os, 'arch').mockReturnValue('x64')
const expected = 'https://test.tld/helm-v3.8.0-darwin-amd64.tar.gz'
expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe(expected)
expect(os.platform).toHaveBeenCalled()
expect(os.arch).toHaveBeenCalled()
})
test('getHelmDownloadURL() - return the URL to download helm for Darwin arm64', () => {
jest.spyOn(os, 'platform').mockReturnValue('darwin')
jest.spyOn(os, 'arch').mockReturnValue('arm64')
const expected = 'https://test.tld/helm-v3.8.0-darwin-arm64.tar.gz'
expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe(expected)
expect(os.platform).toHaveBeenCalled()
expect(os.arch).toHaveBeenCalled()
})
test('getHelmDownloadURL() - return the URL to download helm for Windows', () => {
const downloadBaseURL = 'https://test.tld'
jest.spyOn(os, 'platform').mockReturnValue('win32')
jest.spyOn(os, 'arch').mockReturnValue('x64')
jest.spyOn(os, 'type').mockReturnValue('Windows_NT')
const helmWindowsUrl = 'https://test.tld/helm-v3.8.0-windows-amd64.zip'
expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe(
helmWindowsUrl
)
expect(os.type).toHaveBeenCalled()
const expected = 'https://test.tld/helm-v3.8.0-windows-amd64.zip'
expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe(expected)
expect(os.platform).toHaveBeenCalled()
})
test('getLatestHelmVersion() - return the latest version of HELM', async () => {
@ -101,25 +91,30 @@ describe('run.ts', () => {
expect(await run.getLatestHelmVersion()).toBe('v3.13.3')
})
test('getValidVersion() - return version with v prepended', () => {
expect(run.getValidVersion('3.8.0')).toBe('v3.8.0')
})
test('walkSync() - return path to the all files matching fileToFind in dir', () => {
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => {
if (file == 'mainFolder')
return [
'file1' as unknown as fs.Dirent,
'file2' as unknown as fs.Dirent,
'folder1' as unknown as fs.Dirent,
'folder2' as unknown as fs.Dirent
'file1' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'file2' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'folder1' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'folder2' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
]
if (file == path.join('mainFolder', 'folder1'))
return [
'file11' as unknown as fs.Dirent,
'file12' as unknown as fs.Dirent
'file11' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'file12' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
]
if (file == path.join('mainFolder', 'folder2'))
return [
'file21' as unknown as fs.Dirent,
'file22' as unknown as fs.Dirent
'file21' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'file22' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
]
return []
})
jest.spyOn(core, 'debug').mockImplementation()
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
@ -139,21 +134,22 @@ describe('run.ts', () => {
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => {
if (file == 'mainFolder')
return [
'file1' as unknown as fs.Dirent,
'file2' as unknown as fs.Dirent,
'folder1' as unknown as fs.Dirent,
'folder2' as unknown as fs.Dirent
'file1' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'file2' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'folder1' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'folder2' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
]
if (file == path.join('mainFolder', 'folder1'))
return [
'file11' as unknown as fs.Dirent,
'file12' as unknown as fs.Dirent
'file11' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'file12' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
]
if (file == path.join('mainFolder', 'folder2'))
return [
'file21' as unknown as fs.Dirent,
'file22' as unknown as fs.Dirent
'file21' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>,
'file22' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
]
return []
})
jest.spyOn(core, 'debug').mockImplementation()
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
@ -170,14 +166,16 @@ describe('run.ts', () => {
test('findHelm() - change access permissions and find the helm in given directory', () => {
jest.spyOn(fs, 'chmodSync').mockImplementation(() => {})
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => {
if (file == 'mainFolder') return ['helm.exe' as unknown as fs.Dirent]
if (file == 'mainFolder')
return ['helm.exe' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>]
return []
})
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
const isDirectory =
(file as string).indexOf('folder') == -1 ? false : true
return {isDirectory: () => isDirectory} as fs.Stats
})
jest.spyOn(os, 'type').mockReturnValue('Windows_NT')
jest.spyOn(os, 'platform').mockReturnValue('win32')
expect(run.findHelm('mainFolder')).toBe(
path.join('mainFolder', 'helm.exe')
@ -188,11 +186,13 @@ describe('run.ts', () => {
jest.spyOn(fs, 'chmodSync').mockImplementation(() => {})
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => {
if (file == 'mainFolder') return []
return []
})
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
return {isDirectory: () => true} as fs.Stats
})
jest.spyOn(os, 'type').mockReturnValue('Windows_NT')
jest.spyOn(os, 'platform').mockReturnValue('win32')
expect(() => run.findHelm('mainFolder')).toThrow(
'Helm executable not found in path mainFolder'
)
@ -203,24 +203,22 @@ describe('run.ts', () => {
jest.spyOn(toolCache, 'downloadTool').mockResolvedValue('pathToTool')
const response = JSON.stringify([{tag_name: 'v4.0.0'}])
jest.spyOn(fs, 'readFileSync').mockReturnValue(response)
jest.spyOn(os, 'type').mockReturnValue('Windows_NT')
jest.spyOn(os, 'platform').mockReturnValue('win32')
jest.spyOn(fs, 'chmodSync').mockImplementation(() => {})
jest
.spyOn(toolCache, 'extractZip')
.mockResolvedValue('pathToUnzippedHelm')
jest.spyOn(toolCache, 'extractZip').mockResolvedValue('extractedPath')
jest.spyOn(toolCache, 'cacheDir').mockResolvedValue('pathToCachedDir')
jest
.spyOn(fs, 'readdirSync')
.mockImplementation((file, _) => ['helm.exe' as unknown as fs.Dirent])
.mockImplementation((file, _) => [
'helm.exe' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
])
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
const isDirectory =
(file as string).indexOf('folder') == -1 ? false : true
return {isDirectory: () => isDirectory} as fs.Stats
})
const baseURL = 'https://test.tld'
expect(await run.downloadHelm(baseURL, 'v4.0.0')).toBe(
expect(await run.downloadHelm(downloadBaseURL, 'v4.0.0')).toBe(
path.join('pathToCachedDir', 'helm.exe')
)
expect(toolCache.find).toHaveBeenCalledWith('helm', 'v4.0.0')
@ -240,26 +238,35 @@ describe('run.ts', () => {
jest.spyOn(toolCache, 'downloadTool').mockImplementation(async () => {
throw 'Unable to download'
})
jest.spyOn(os, 'type').mockReturnValue('Windows_NT')
jest.spyOn(os, 'platform').mockReturnValue('win32')
const baseURL = 'https://test.tld'
await expect(run.downloadHelm(baseURL, 'v3.2.1')).rejects.toThrow(
'Failed to download Helm from location https://test.tld/helm-v3.2.1-windows-amd64.zip'
const downloadUrl = 'https://test.tld/helm-v3.2.1-windows-amd64.zip'
await expect(run.downloadHelm(downloadBaseURL, 'v3.2.1')).rejects.toThrow(
`Failed to download Helm from location ${downloadUrl}`
)
expect(toolCache.find).toHaveBeenCalledWith('helm', 'v3.2.1')
expect(toolCache.downloadTool).toHaveBeenCalledWith(
'https://test.tld/helm-v3.2.1-windows-amd64.zip'
)
expect(toolCache.downloadTool).toHaveBeenCalledWith(`${downloadUrl}`)
})
test('downloadHelm() - return path to helm tool with same version from toolCache', async () => {
jest.spyOn(toolCache, 'find').mockReturnValue('pathToCachedDir')
jest.spyOn(toolCache, 'cacheDir').mockResolvedValue('pathToCachedDir')
jest.spyOn(toolCache, 'downloadTool').mockResolvedValue('pathToTool')
jest.spyOn(toolCache, 'extractZip').mockResolvedValue('extractedPath')
jest.spyOn(os, 'platform').mockReturnValue('win32')
jest.spyOn(fs, 'chmodSync').mockImplementation(() => {})
jest
.spyOn(fs, 'readdirSync')
.mockReturnValue([
'helm.exe' as unknown as fs.Dirent<Buffer<ArrayBufferLike>>
])
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
const isDirectory =
(file as string).indexOf('folder') == -1 ? false : true
return {isDirectory: () => isDirectory} as fs.Stats
})
const baseURL = 'https://test.tld'
expect(await run.downloadHelm(baseURL, 'v3.2.1')).toBe(
expect(await run.downloadHelm(downloadBaseURL, 'v3.2.1')).toBe(
path.join('pathToCachedDir', 'helm.exe')
)
expect(toolCache.find).toHaveBeenCalledWith('helm', 'v3.2.1')
@ -272,12 +279,11 @@ describe('run.ts', () => {
test('downloadHelm() - throw error is helm is not found in path', async () => {
jest.spyOn(toolCache, 'find').mockReturnValue('')
jest.spyOn(toolCache, 'downloadTool').mockResolvedValue('pathToTool')
jest.spyOn(os, 'type').mockReturnValue('Windows_NT')
jest.spyOn(fs, 'chmodSync').mockImplementation()
jest
.spyOn(toolCache, 'extractZip')
.mockResolvedValue('pathToUnzippedHelm')
jest.spyOn(toolCache, 'cacheDir').mockResolvedValue('pathToCachedDir')
jest.spyOn(toolCache, 'downloadTool').mockResolvedValue('pathToTool')
jest.spyOn(toolCache, 'extractZip').mockResolvedValue('extractedPath')
jest.spyOn(os, 'platform').mockReturnValue('win32')
jest.spyOn(fs, 'chmodSync').mockImplementation()
jest.spyOn(fs, 'readdirSync').mockImplementation((file, _) => [])
jest.spyOn(fs, 'statSync').mockImplementation((file) => {
const isDirectory =
@ -285,9 +291,7 @@ describe('run.ts', () => {
return {isDirectory: () => isDirectory} as fs.Stats
})
const baseURL = 'https://test.tld'
await expect(run.downloadHelm(baseURL, 'v3.2.1')).rejects.toThrow(
await expect(run.downloadHelm(downloadBaseURL, 'v3.2.1')).rejects.toThrow(
'Helm executable not found in path pathToCachedDir'
)
expect(toolCache.find).toHaveBeenCalledWith('helm', 'v3.2.1')

View File

@ -1,5 +1,4 @@
// Copyright (c) Microsoft Corporation.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import * as os from 'os'
@ -26,7 +25,7 @@ export async function run() {
const downloadBaseURL = core.getInput('downloadBaseURL', {required: false})
core.startGroup(`Downloading ${version}`)
core.startGroup(`Installing ${version}`)
const cachedPath = await downloadHelm(downloadBaseURL, version)
core.endGroup()
@ -61,41 +60,24 @@ export async function getLatestHelmVersion(): Promise<string> {
}
}
export function getExecutableExtension(): string {
if (os.type().match(/^Win/)) {
return '.exe'
}
return ''
export function getArch(): string {
return os.arch() === 'x64' ? 'amd64' : os.arch()
}
export function getPlatform(): string {
return os.platform() === 'win32' ? 'windows' : os.platform()
}
export function getArchiveExtension(): string {
return os.platform() === 'win32' ? 'zip' : 'tar.gz'
}
export function getExecutableExtension(): string {
return os.platform() === 'win32' ? '.exe' : ''
}
const LINUX = 'Linux'
const MAC_OS = 'Darwin'
const WINDOWS = 'Windows_NT'
const ARM64 = 'arm64'
export function getHelmDownloadURL(baseURL: string, version: string): string {
const arch = os.arch()
const operatingSystem = os.type()
let urlPath = ''
switch (true) {
case operatingSystem == LINUX && arch == ARM64:
urlPath = util.format(`/helm-%s-linux-arm64.zip`, version)
break
case operatingSystem == LINUX:
urlPath = util.format(`/helm-%s-linux-amd64.zip`, version)
break
case operatingSystem == MAC_OS && arch == ARM64:
urlPath = util.format(`/helm-%s-darwin-arm64.zip`, version)
break
case operatingSystem == MAC_OS:
urlPath = util.format(`/helm-%s-darwin-amd64.zip`, version)
break
case operatingSystem == WINDOWS:
default:
urlPath = util.format(`/helm-%s-windows-amd64.zip`, version)
}
const urlPath = `helm-${version}-${getPlatform()}-${getArch()}.${getArchiveExtension()}`
const url = new URL(urlPath, baseURL)
return url.toString()
}
@ -105,7 +87,10 @@ export async function downloadHelm(
version: string
): Promise<string> {
let cachedToolpath = toolCache.find(helmToolName, version)
if (!cachedToolpath) {
if (cachedToolpath) {
core.info(`Restoring '${version}' from cache`)
} else {
core.info(`Downloading '${version}' from '${baseURL}'`)
let helmDownloadPath
try {
helmDownloadPath = await toolCache.downloadTool(
@ -121,9 +106,13 @@ export async function downloadHelm(
}
fs.chmodSync(helmDownloadPath, '777')
const unzipedHelmPath = await toolCache.extractZip(helmDownloadPath)
const extractedPath =
getPlatform() === 'windows'
? await toolCache.extractZip(helmDownloadPath)
: await toolCache.extractTar(helmDownloadPath)
cachedToolpath = await toolCache.cacheDir(
unzipedHelmPath,
extractedPath,
helmToolName,
version
)
@ -168,5 +157,3 @@ export var walkSync = function (dir, filelist, fileToFind) {
})
return filelist
}
run().catch(core.setFailed)