Compare commits
23 Commits
releases/v
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d32a4a4431 | ||
|
|
1fad258c52 | ||
|
|
74c9f46077 | ||
|
|
2d0efb3410 | ||
|
|
d73190731a | ||
|
|
6563d5d80a | ||
|
|
a76651a0e0 | ||
|
|
cf5fdd749b | ||
|
|
de1d5ec5de | ||
|
|
e6e81bbc41 | ||
|
|
30d747582d | ||
|
|
f4440b5470 | ||
|
|
0fd96d6276 | ||
|
|
4ef821e7ca | ||
|
|
95e0936d6e | ||
|
|
87e53e3f71 | ||
|
|
13bef3ca00 | ||
|
|
023f859e5d | ||
|
|
6bd1f0daf1 | ||
|
|
574933e749 | ||
|
|
46ce001b45 | ||
|
|
f7a3237edf | ||
|
|
9c31f8cc61 |
@ -59,7 +59,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@17a820bf2e43b47be2c72b39cc905417bc1ab6d0 # v3.28.6
|
||||
uses: github/codeql-action/init@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
build-mode: ${{ matrix.build-mode }}
|
||||
@ -86,6 +86,6 @@ jobs:
|
||||
echo ' make release'
|
||||
exit 1
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@17a820bf2e43b47be2c72b39cc905417bc1ab6d0 # v3.28.6
|
||||
uses: github/codeql-action/analyze@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
|
||||
with:
|
||||
category: '/language:${{matrix.language}}'
|
||||
@ -29,7 +29,7 @@ jobs:
|
||||
npm run build
|
||||
fi
|
||||
|
||||
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
|
||||
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
||||
name: Install Python
|
||||
with:
|
||||
python-version: '3.x'
|
||||
@ -13,7 +13,7 @@ jobs:
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
cache: 'npm'
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@ -3,6 +3,8 @@
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
yarn.lock
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
@ -330,3 +332,4 @@ ASALocalRun/
|
||||
node_modules
|
||||
|
||||
# Transpiled JS
|
||||
lib/
|
||||
|
||||
@ -5,9 +5,10 @@
|
||||
Acceptable values are latest or any semantic version string like `v1.15.0`. Use this action in workflow to define which version of kubectl will be used.
|
||||
|
||||
```yaml
|
||||
- uses: azure/setup-kubectl@v4
|
||||
- uses: action/setup-kubectl-cn@v4.1
|
||||
with:
|
||||
version: '<version>' # default is latest stable
|
||||
url: https://dl.k8s.io/release/${version}/bin/linux/${arch}/kubectl # custom download url
|
||||
id: install
|
||||
```
|
||||
|
||||
|
||||
@ -5,6 +5,10 @@ inputs:
|
||||
description: 'Version of kubectl'
|
||||
required: true
|
||||
default: 'latest'
|
||||
url:
|
||||
description: 'Url of kubectl'
|
||||
required: false
|
||||
default: ''
|
||||
outputs:
|
||||
kubectl-path:
|
||||
description: 'Path to the cached kubectl binary'
|
||||
|
||||
6280
lib/index.js
6280
lib/index.js
File diff suppressed because it is too large
Load Diff
590
package-lock.json
generated
590
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@ -20,16 +20,15 @@
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/exec": "^1.0.0",
|
||||
"@actions/tool-cache": "^2.0.2",
|
||||
"ncc": "^0.3.6"
|
||||
"@actions/tool-cache": "^2.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "^22.10.10",
|
||||
"@types/node": "^22.15.17",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"jest": "^29.7.0",
|
||||
"prettier": "3.4.2",
|
||||
"ts-jest": "^29.2.5",
|
||||
"typescript": "5.7.3"
|
||||
"prettier": "3.5.3",
|
||||
"ts-jest": "^29.3.2",
|
||||
"typescript": "5.8.3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,10 @@ export function getKubectlArch(): string {
|
||||
return arch
|
||||
}
|
||||
|
||||
export function getkubectlDownloadURL(version: string, arch: string): string {
|
||||
export function getkubectlDownloadURL(version: string, arch: string, url: string = ''): string {
|
||||
if (url != '') {
|
||||
return url.replace('${version}', version).replace('${arch}', arch)
|
||||
}
|
||||
switch (os.type()) {
|
||||
case 'Linux':
|
||||
return `https://dl.k8s.io/release/${version}/bin/linux/${arch}/kubectl`
|
||||
|
||||
@ -18,10 +18,11 @@ const stableVersionUrl =
|
||||
|
||||
export async function run() {
|
||||
let version = core.getInput('version', {required: true})
|
||||
let toolurl = core.getInput('url', {required: false})
|
||||
if (version.toLocaleLowerCase() === 'latest') {
|
||||
version = await getStableKubectlVersion()
|
||||
}
|
||||
const cachedPath = await downloadKubectl(version)
|
||||
const cachedPath = await downloadKubectl(version, toolurl)
|
||||
|
||||
core.addPath(path.dirname(cachedPath))
|
||||
|
||||
@ -48,14 +49,14 @@ export async function getStableKubectlVersion(): Promise<string> {
|
||||
)
|
||||
}
|
||||
|
||||
export async function downloadKubectl(version: string): Promise<string> {
|
||||
export async function downloadKubectl(version: string, toolurl: string = ''): Promise<string> {
|
||||
let cachedToolpath = toolCache.find(kubectlToolName, version)
|
||||
let kubectlDownloadPath = ''
|
||||
const arch = getKubectlArch()
|
||||
if (!cachedToolpath) {
|
||||
try {
|
||||
kubectlDownloadPath = await toolCache.downloadTool(
|
||||
getkubectlDownloadURL(version, arch)
|
||||
getkubectlDownloadURL(version, arch, toolurl)
|
||||
)
|
||||
} catch (exception) {
|
||||
if (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user