7 Commits

Author SHA1 Message Date
9130a7accc 内网源 2023-10-24 13:40:03 +08:00
github-actions[bot]
5119fcb908 v3 new release (#104)
bump @actions/core
2022-12-12 13:52:09 -05:00
github-actions[bot]
f382f75448 v3 new release (#101) 2022-10-27 10:04:25 -04:00
github-actions[bot]
b5b231a831 v3 new release (#89) 2022-07-25 14:01:37 -04:00
github-actions[bot]
84b304dfb7 v3 new release (#87)
add token
2022-07-25 13:23:27 -04:00
github-actions[bot]
e4f3964f67 v3 new release (#84)
swap to graphql
2022-07-11 13:48:02 -04:00
github-actions[bot]
20d2b4f98d v3 new release (#80) 2022-06-27 14:17:15 -04:00
10 changed files with 11912 additions and 33 deletions

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@v6
- uses: actions/stale@v3
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@v6
- uses: actions/stale@v3
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@v3
uses: actions/checkout@v2
- name: npm install and build
id: action-npm-build
run: |

View File

@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Enforce Prettier
uses: actionsx/prettier@v2

View File

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

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

@@ -14,7 +14,7 @@ Acceptable values are latest or any semantic version string like v3.5.0 Use this
id: install
```
> Note: When using latest version you might hit the GitHub GraphQL API hourly rate limit of 5,000. The action will then return the hardcoded default stable version (currently v3.11.1). If you rely on a certain version higher than the default, you should use that version instead of latest.
> Note: When using latest version you might hit the GitHub GraphQL API hourly rate limit of 5,000. The action will then return the hardcoded default stable version (currently v3.9.0). If you rely on a certain version higher than the default, you should 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

11879
lib/index.js Normal file

File diff suppressed because one or more lines are too long

24
package-lock.json generated
View File

@@ -1966,9 +1966,9 @@
"dev": true
},
"node_modules/decode-uri-component": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz",
"integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==",
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
"integrity": "sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og==",
"dev": true,
"engines": {
"node": ">=0.10"
@@ -3753,9 +3753,9 @@
"dev": true
},
"node_modules/json5": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
"dev": true,
"bin": {
"json5": "lib/cli.js"
@@ -7852,9 +7852,9 @@
"dev": true
},
"decode-uri-component": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz",
"integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==",
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
"integrity": "sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og==",
"dev": true
},
"deep-is": {
@@ -9233,9 +9233,9 @@
"dev": true
},
"json5": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
"dev": true
},
"kind-of": {

View File

@@ -23,19 +23,19 @@ describe('run.ts', () => {
test('getHelmDownloadURL() - return the URL to download helm for Linux', () => {
jest.spyOn(os, 'type').mockReturnValue('Linux')
jest.spyOn(os, 'arch').mockReturnValueOnce('unknown')
const helmLinuxUrl = 'https://get.helm.sh/helm-v3.8.0-linux-amd64.zip'
const kubectlLinuxUrl = 'https://get.helm.sh/helm-v3.8.0-linux-amd64.zip'
expect(run.getHelmDownloadURL('v3.8.0')).toBe(helmLinuxUrl)
expect(run.getHelmDownloadURL('v3.8.0')).toBe(kubectlLinuxUrl)
expect(os.type).toBeCalled()
expect(os.arch).toBeCalled()
// arm64
jest.spyOn(os, 'type').mockReturnValue('Linux')
jest.spyOn(os, 'arch').mockReturnValueOnce('arm64')
const helmLinuxArm64Url =
const kubectlLinuxArm64Url =
'https://get.helm.sh/helm-v3.8.0-linux-arm64.zip'
expect(run.getHelmDownloadURL('v3.8.0')).toBe(helmLinuxArm64Url)
expect(run.getHelmDownloadURL('v3.8.0')).toBe(kubectlLinuxArm64Url)
expect(os.type).toBeCalled()
expect(os.arch).toBeCalled()
})
@@ -43,19 +43,20 @@ describe('run.ts', () => {
test('getHelmDownloadURL() - return the URL to download helm for Darwin', () => {
jest.spyOn(os, 'type').mockReturnValue('Darwin')
jest.spyOn(os, 'arch').mockReturnValueOnce('unknown')
const helmDarwinUrl = 'https://get.helm.sh/helm-v3.8.0-darwin-amd64.zip'
const kubectlDarwinUrl =
'https://get.helm.sh/helm-v3.8.0-darwin-amd64.zip'
expect(run.getHelmDownloadURL('v3.8.0')).toBe(helmDarwinUrl)
expect(run.getHelmDownloadURL('v3.8.0')).toBe(kubectlDarwinUrl)
expect(os.type).toBeCalled()
expect(os.arch).toBeCalled()
// arm64
jest.spyOn(os, 'type').mockReturnValue('Darwin')
jest.spyOn(os, 'arch').mockReturnValueOnce('arm64')
const helmDarwinArm64Url =
const kubectlDarwinArm64Url =
'https://get.helm.sh/helm-v3.8.0-darwin-arm64.zip'
expect(run.getHelmDownloadURL('v3.8.0')).toBe(helmDarwinArm64Url)
expect(run.getHelmDownloadURL('v3.8.0')).toBe(kubectlDarwinArm64Url)
expect(os.type).toBeCalled()
expect(os.arch).toBeCalled()
})
@@ -67,13 +68,14 @@ describe('run.ts', () => {
test('getHelmDownloadURL() - return the URL to download helm for Windows', () => {
jest.spyOn(os, 'type').mockReturnValue('Windows_NT')
const helmWindowsUrl = 'https://get.helm.sh/helm-v3.8.0-windows-amd64.zip'
expect(run.getHelmDownloadURL('v3.8.0')).toBe(helmWindowsUrl)
const kubectlWindowsUrl =
'https://get.helm.sh/helm-v3.8.0-windows-amd64.zip'
expect(run.getHelmDownloadURL('v3.8.0')).toBe(kubectlWindowsUrl)
expect(os.type).toBeCalled()
})
test('getLatestHelmVersion() - return the stable version of HELM since its not authenticated', async () => {
expect(await run.getLatestHelmVersion()).toBe('v3.11.1')
expect(await run.getLatestHelmVersion()).toBe('v3.9.0')
})
test('walkSync() - return path to the all files matching fileToFind in dir', () => {

View File

@@ -11,9 +11,10 @@ import * as toolCache from '@actions/tool-cache'
import * as core from '@actions/core'
import {graphql} from '@octokit/graphql'
import {createActionAuth} from '@octokit/auth-action'
import {create} from 'domain'
const helmToolName = 'helm'
const stableHelmVersion = 'v3.11.1'
const stableHelmVersion = 'v3.9.0'
export async function run() {
let version = core.getInput('version', {required: true})