mirror of
https://github.com/imranismail/setup-kustomize.git
synced 2026-05-17 10:15:23 +00:00
bump dependencies and add getPinnedVersion resolver to speed up pinned version lookups
This commit is contained in:
@@ -44,7 +44,8 @@
|
||||
"semi": "off",
|
||||
"@typescript-eslint/semi": ["error", "never"],
|
||||
"@typescript-eslint/type-annotation-spacing": "error",
|
||||
"@typescript-eslint/unbound-method": "error"
|
||||
"@typescript-eslint/unbound-method": "error",
|
||||
"i18n-text/no-en": "off"
|
||||
},
|
||||
"env": {
|
||||
"node": true,
|
||||
|
||||
@@ -1 +1 @@
|
||||
nodejs 17.7.1
|
||||
nodejs 20.8.1
|
||||
@@ -35,6 +35,22 @@ describe('installer tests', () => {
|
||||
}
|
||||
})
|
||||
|
||||
it('Acquires kustomize version 5.2.1', async () => {
|
||||
await installer.getKustomize('5.2.1')
|
||||
const kustomizeDir = path.join(toolDir, 'kustomize', '5.2.1', os.arch())
|
||||
|
||||
expect(fs.existsSync(`${kustomizeDir}.complete`)).toBe(true)
|
||||
|
||||
if (IS_WINDOWS) {
|
||||
expect(fs.existsSync(path.join(kustomizeDir, 'kustomize.exe'))).toBe(true)
|
||||
} else {
|
||||
expect(fs.existsSync(path.join(kustomizeDir, 'kustomize'))).toBe(true)
|
||||
expect(() =>
|
||||
fs.accessSync(path.join(kustomizeDir, 'kustomize'), fs.constants.X_OK)
|
||||
).not.toThrow()
|
||||
}
|
||||
})
|
||||
|
||||
it('Acquires kustomize version 3.2.0', async () => {
|
||||
await installer.getKustomize('3.2.0')
|
||||
const kustomizeDir = path.join(toolDir, 'kustomize', '3.2.0', os.arch())
|
||||
|
||||
@@ -18,5 +18,5 @@ inputs:
|
||||
required: false
|
||||
default: 'true'
|
||||
runs:
|
||||
using: 'node16'
|
||||
using: 'node20'
|
||||
main: 'dist/index.js'
|
||||
|
||||
41724
dist/index.js
vendored
41724
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
145
dist/licenses.txt
vendored
145
dist/licenses.txt
vendored
@@ -12,9 +12,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
@actions/exec
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/github
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/http-client
|
||||
MIT
|
||||
@@ -65,6 +83,28 @@ The above copyright notice and this permission notice shall be included in all c
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@fastify/busboy
|
||||
MIT
|
||||
Copyright Brian White. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
|
||||
@octokit/auth-token
|
||||
MIT
|
||||
The MIT License
|
||||
@@ -262,16 +302,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
@vercel/ncc
|
||||
MIT
|
||||
Copyright 2018 ZEIT, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
before-after-hook
|
||||
Apache-2.0
|
||||
Apache License
|
||||
@@ -564,32 +594,6 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
node-fetch
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 David Frank
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
|
||||
once
|
||||
ISC
|
||||
The ISC License
|
||||
@@ -628,9 +632,6 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
tr46
|
||||
MIT
|
||||
|
||||
tunnel
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
@@ -656,6 +657,31 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
undici
|
||||
MIT
|
||||
MIT License
|
||||
|
||||
Copyright (c) Matteo Collina and Undici contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
universal-user-agent
|
||||
ISC
|
||||
# [ISC License](https://spdx.org/licenses/ISC)
|
||||
@@ -680,47 +706,6 @@ The above copyright notice and this permission notice shall be included in all c
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
webidl-conversions
|
||||
BSD-2-Clause
|
||||
# The BSD 2-Clause License
|
||||
|
||||
Copyright (c) 2014, Domenic Denicola
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
whatwg-url
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015–2016 Sebastian Mayr
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
wrappy
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
2
dist/sourcemap-register.js
vendored
2
dist/sourcemap-register.js
vendored
File diff suppressed because one or more lines are too long
15707
package-lock.json
generated
15707
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
34
package.json
34
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "setup-kustomize",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"private": true,
|
||||
"description": "Github action to setup-kustomize",
|
||||
"main": "lib/main.js",
|
||||
@@ -26,26 +26,26 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.6",
|
||||
"@actions/github": "^4.0.0",
|
||||
"@actions/github": "^6.0.0",
|
||||
"@actions/io": "^1.1.1",
|
||||
"@actions/tool-cache": "^1.7.1",
|
||||
"@octokit/plugin-throttling": "^3.4.1",
|
||||
"semver": "^7.3.2"
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"@octokit/plugin-throttling": "^8.0.1",
|
||||
"semver": "^7.5.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.4.1",
|
||||
"@types/node": "~17.0",
|
||||
"@types/jest": "^29.5.6",
|
||||
"@types/node": "^20.8.8",
|
||||
"@types/semver": "^7.3.9",
|
||||
"@typescript-eslint/parser": "^4.8.1",
|
||||
"@vercel/ncc": "^0.33.3",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-plugin-github": "^4.1.1",
|
||||
"eslint-plugin-jest": "^24.1.3",
|
||||
"jest": "^26.6.3",
|
||||
"jest-circus": "^26.6.3",
|
||||
"@typescript-eslint/parser": "^6.9.0",
|
||||
"@vercel/ncc": "^0.38.1",
|
||||
"eslint": "^8.52.0",
|
||||
"eslint-plugin-github": "^4.10.1",
|
||||
"eslint-plugin-jest": "^27.4.3",
|
||||
"jest": "^29.7.0",
|
||||
"jest-circus": "^29.7.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"prettier": "2.5.1",
|
||||
"ts-jest": "^26.4.4",
|
||||
"typescript": "^4.1.3"
|
||||
"prettier": "^3.0.3",
|
||||
"ts-jest": "^29.1.1",
|
||||
"typescript": "^5.2.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {GitHub, getOctokitOptions} from '@actions/github/lib/utils'
|
||||
import {OctokitOptions} from '@octokit/core/dist-types/types'
|
||||
import {OctokitOptions} from '@octokit/core/dist-types/types.d'
|
||||
import {throttling} from '@octokit/plugin-throttling'
|
||||
import * as core from '@actions/core'
|
||||
import * as cache from '@actions/tool-cache'
|
||||
@@ -24,7 +24,7 @@ let options: OctokitOptions = {
|
||||
}
|
||||
return !failFast
|
||||
},
|
||||
onAbuseLimit: (retryAfter: Number, opts: OctokitOptions) => {
|
||||
onSecondaryRateLimit: (retryAfter: Number, opts: OctokitOptions) => {
|
||||
core.warning(`Abuse detected for request ${opts.method} ${opts.url}`)
|
||||
if (!failFast) {
|
||||
core.warning(`Retrying after ${retryAfter} seconds!`)
|
||||
@@ -65,10 +65,14 @@ export async function getKustomize(targetVersion: string): Promise<void> {
|
||||
if (!semver.validRange(targetVersion))
|
||||
throw new Error(`invalid semver requested: ${targetVersion}`)
|
||||
|
||||
const resolver = semver.valid(targetVersion)
|
||||
? getPinnedVersion
|
||||
: getMaxSatisfyingVersion
|
||||
|
||||
let kustomizePath = cache.find('kustomize', targetVersion)
|
||||
|
||||
if (!kustomizePath) {
|
||||
const version = await getMaxSatisfyingVersion(targetVersion)
|
||||
const version = await resolver(targetVersion)
|
||||
kustomizePath = await acquireVersion(version)
|
||||
}
|
||||
|
||||
@@ -81,6 +85,55 @@ interface Version {
|
||||
url: string
|
||||
}
|
||||
|
||||
async function getPinnedVersion(targetVersion: string): Promise<Version> {
|
||||
const prefix = semver.gt(targetVersion, '3.2.0') ? 'kustomize/v' : 'v'
|
||||
|
||||
try {
|
||||
const response = await octokit.rest.repos.getReleaseByTag({
|
||||
owner: 'kubernetes-sigs',
|
||||
repo: 'kustomize',
|
||||
tag: prefix + targetVersion
|
||||
})
|
||||
|
||||
if (response.status !== 200) {
|
||||
throw new Error(`Invalid response status ${response.status}`)
|
||||
}
|
||||
|
||||
const release = response.data
|
||||
|
||||
const matchingAsset = release.assets.find(
|
||||
asset =>
|
||||
asset.name.includes('kustomize') &&
|
||||
asset.name.includes(platform) &&
|
||||
asset.name.includes(arch)
|
||||
)
|
||||
|
||||
if (matchingAsset) {
|
||||
const kustomizeVersion = (
|
||||
versionRegex.exec(release.tag_name) || []
|
||||
).shift()
|
||||
|
||||
if (kustomizeVersion != null) {
|
||||
return {
|
||||
target: targetVersion,
|
||||
resolved: kustomizeVersion,
|
||||
url: matchingAsset.browser_download_url
|
||||
}
|
||||
} else {
|
||||
throw new Error(
|
||||
`Could not find version in release tag ${release.tag_name}`
|
||||
)
|
||||
}
|
||||
} else {
|
||||
throw new Error(
|
||||
`Could not find asset for platform '${platform}' and '${arch}'.`
|
||||
)
|
||||
}
|
||||
} catch (err) {
|
||||
throw new Error(`Could not satisfy version range ${targetVersion}: ${err}`)
|
||||
}
|
||||
}
|
||||
|
||||
async function getMaxSatisfyingVersion(
|
||||
targetVersion: string
|
||||
): Promise<Version> {
|
||||
@@ -88,7 +141,7 @@ async function getMaxSatisfyingVersion(
|
||||
const availableVersions: Map<string, string> = new Map()
|
||||
|
||||
for await (const response of octokit.paginate.iterator(
|
||||
octokit.repos.listReleases,
|
||||
octokit.rest.repos.listReleases,
|
||||
{
|
||||
owner: 'kubernetes-sigs',
|
||||
repo: 'kustomize',
|
||||
@@ -125,7 +178,8 @@ async function getMaxSatisfyingVersion(
|
||||
|
||||
if (!resolved) {
|
||||
throw new Error(
|
||||
`Unable to find Kustomize version '${version.target}' for platform '${platform}' and architecture ${arch}.`
|
||||
`Could not satisfy version '${version.target}': Could not find asset for platform '${platform}' and
|
||||
${arch}'.`
|
||||
)
|
||||
}
|
||||
|
||||
@@ -142,7 +196,6 @@ async function acquireVersion(version: Version): Promise<string> {
|
||||
try {
|
||||
toolPath = await cache.downloadTool(version.url)
|
||||
} catch (err) {
|
||||
core.debug(err)
|
||||
throw new Error(`Failed to download version ${version.target}: ${err}`)
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ async function run(): Promise<void> {
|
||||
await installer.getKustomize(version)
|
||||
}
|
||||
} catch (error) {
|
||||
core.setFailed(error.message)
|
||||
core.setFailed(`${error}`)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user