Compare commits

..

30 Commits

Author SHA1 Message Date
imranismail
2ba527d4d0 bump dependencies and add getPinnedVersion resolver to speed up pinned version lookups 2023-10-24 18:32:32 +13:00
Imran Ismail
a76db1c641 Update README.md 2022-10-17 02:28:13 +08:00
Imran Ismail
6691bdeb1b Set version to v2.0.0 2022-10-17 02:25:22 +08:00
Imran Ismail
86a0af5aa8 Use core.getBooleanInput (#280)
* Use core.getBooleanInput

* Update test
2022-10-17 02:22:29 +08:00
Imran Ismail
8757bab9d6 Default fail-fast to true (#279) 2022-10-17 02:13:54 +08:00
Imran Ismail
32e634d4e0 Increase per page limit to 100 (#278)
* Increase per page limit to 100

* Add build
2022-10-17 02:04:29 +08:00
Imran Ismail
5f57b3222d Use releases to keep track of changelogs 2022-10-17 01:58:49 +08:00
Imran Ismail
9e8cf604e6 Set version in package.json 2022-10-17 01:58:34 +08:00
Imran Ismail
da3f4f22f0 Address vulnerabilities raised by Github (#276) 2022-10-17 01:51:44 +08:00
Peter Thorin
841007459d Use Node 16 (#273)
See [GitHub Actions: All Actions will begin running on Node16 instead of Node12](https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/)
2022-10-17 01:49:13 +08:00
Imran Ismail
aa978fb4ab Cut a release 2022-09-06 18:02:54 +08:00
Philipp Riederer
5bd9c67dee fail fast on github rate limit (#263) 2022-09-06 17:59:48 +08:00
dependabot[bot]
97446b23bf Bump @actions/tool-cache from 1.6.1 to 1.7.1 (#240)
Bumps [@actions/tool-cache](https://github.com/actions/toolkit/tree/HEAD/packages/tool-cache) from 1.6.1 to 1.7.1.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/tool-cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/tool-cache)

---
updated-dependencies:
- dependency-name: "@actions/tool-cache"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-17 16:57:52 +08:00
dependabot[bot]
18af3b305d Bump eslint from 7.26.0 to 7.32.0 (#241)
Bumps [eslint](https://github.com/eslint/eslint) from 7.26.0 to 7.32.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.26.0...v7.32.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-17 16:57:11 +08:00
dependabot[bot]
058459647a Bump @types/semver from 7.3.5 to 7.3.9 (#239)
Bumps [@types/semver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/semver) from 7.3.5 to 7.3.9.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/semver)

---
updated-dependencies:
- dependency-name: "@types/semver"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-17 16:56:40 +08:00
dependabot[bot]
d8f8e8a8c7 Bump @actions/io from 1.1.0 to 1.1.1 (#238)
Bumps [@actions/io](https://github.com/actions/toolkit/tree/HEAD/packages/io) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/io/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/@actions/tool-cache@1.1.1/packages/io)

---
updated-dependencies:
- dependency-name: "@actions/io"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-17 16:56:29 +08:00
Imran Ismail
8fa954828e Bump to v1.6.1 2022-03-15 22:27:37 +08:00
Imran Ismail
51f249a5a4 Update lockfile 2022-03-15 22:23:36 +08:00
dependabot[bot]
d4a94f2227 Bump ansi-regex from 5.0.0 to 5.0.1 (#231)
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v5.0.0...v5.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-15 22:20:50 +08:00
dependabot[bot]
8975f1988c Bump tmpl from 1.0.4 to 1.0.5 (#232)
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-15 22:20:43 +08:00
dependabot[bot]
79ebb54aee Bump path-parse from 1.0.6 to 1.0.7 (#233)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-15 22:20:35 +08:00
dependabot[bot]
4ebf871144 Bump @types/jest from 26.0.23 to 27.4.1 (#234)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 26.0.23 to 27.4.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

---
updated-dependencies:
- dependency-name: "@types/jest"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-15 22:20:27 +08:00
dependabot[bot]
b5ea91485d Bump node-fetch from 2.6.1 to 2.6.7 (#235)
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.1 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.1...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-15 22:20:14 +08:00
dependabot[bot]
c090480e53 Bump ws from 7.4.5 to 7.5.7 (#236)
Bumps [ws](https://github.com/websockets/ws) from 7.4.5 to 7.5.7.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.4.5...7.5.7)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-15 22:19:57 +08:00
dependabot[bot]
bd0edb85fb Bump js-yaml from 3.14.1 to 4.1.0 (#135)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.14.1 to 4.1.0.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.14.1...4.1.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-15 22:19:06 +08:00
Imran Ismail
55191c7b61 Update package.json 2022-03-15 22:18:37 +08:00
dependabot[bot]
9f90af1b02 Bump @vercel/ncc from 0.25.1 to 0.33.3 (#227)
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.25.1 to 0.33.3.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.25.1...0.33.3)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-15 22:15:25 +08:00
dependabot[bot]
c4446ec4f6 Bump lodash from 4.17.19 to 4.17.21 (#130)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-15 22:14:53 +08:00
dependabot[bot]
7b7a2518ae Bump prettier from 2.2.1 to 2.5.1 (#208)
Bumps [prettier](https://github.com/prettier/prettier) from 2.2.1 to 2.5.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/2.2.1...2.5.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-15 22:14:45 +08:00
Imran Ismail
3aa72b92bd Update README.md 2021-05-12 14:06:41 +08:00
14 changed files with 35377 additions and 23067 deletions

View File

@@ -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,

View File

@@ -1 +1 @@
nodejs 15.14.0
nodejs 20.8.1

View File

@@ -1,42 +0,0 @@
# Changelog
## v1.5.2
### Security
- Bump @actions/core to v1.2.6 to address deprecations raised in #30
## v1.5.1
### Changed
- Cache kustomize by requested version spec as key
## v1.5.0
### Changed
- Simplified asset look up
## v1.4.0
### Added
- Adds support for semver version ranges. Example: 3.x, 3.2.x
- Add a step in the workflow to test the action with default value
## v1.2.0
N/A
## v1.1.0
### Fixed
- Support for new download path for kustomize
## v1.0.0
### Changed
- Update metadata

View File

@@ -8,10 +8,11 @@ Install any kustomize version as a step in your workflow
Every argument is optional.
| Input | Description |
| ------------------- | ------------------------------------------------------------------------------------------------------ |
| `github-token` | PAT (Personal Access Token) for authorizing the repository.<br>_Defaults to **\${{ github.token }}**_. |
| `kustomize-version` | Version Spec of the version to use. Examples: 10.x, 10.15.1, >=10.15.0.<br>_Defaults to **\***_. |
| Input | Description |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `github-token` | PAT (Personal Access Token) for authorizing the repository.<br>_Defaults to **\${{ github.token }}**_ |
| `kustomize-version` | Semver of kustomize to use. Examples: `10.x`, `10.15.1`, `>=10.15.0`<br>_Defaults to **\***_ |
| `fail-fast` | When github rate limits us, fail immediately or retry after the timeout that github wishes from us? <br>Note: When this is set to `false`, a github workflow might accrue a long (and possibly expensive) runtime.<br>_Defaults to **true**_ |
## Usage
@@ -27,7 +28,7 @@ jobs:
needs:
- publish-image
steps:
- uses: imranismail/setup-kustomize@v1
- uses: imranismail/setup-kustomize@v2
- run: |
kustomize edit set image app:${GITHUB_SHA}
git add .

View File

@@ -8,6 +8,7 @@ const tempDir = path.join(__dirname, 'runner', 'temp')
process.env['RUNNER_TOOL_CACHE'] = toolDir
process.env['RUNNER_TEMP'] = tempDir
process.env['INPUT_FAIL-FAST'] = 'true'
import * as installer from '../src/installer'
@@ -34,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())

View File

@@ -13,6 +13,10 @@ inputs:
description: 'Token for the repository. Can be passed in using `{{ secrets.GITHUB_TOKEN }}`.'
required: false
default: ${{ github.token }}
fail-fast:
description: 'Fail quickly on github rate limit. "false" or "true".'
required: false
default: 'true'
runs:
using: 'node12'
using: 'node20'
main: 'dist/index.js'

38644
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

117
dist/licenses.txt vendored
View File

@@ -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
@@ -653,22 +657,11 @@ 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)
Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m)
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
uuid
undici
MIT
The MIT License (MIT)
MIT License
Copyright (c) 2010-2016 Robert Kieffer and other contributors
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
@@ -689,6 +682,30 @@ 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)
Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m)
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
uuid
MIT
The MIT License (MIT)
Copyright (c) 2010-2020 Robert Kieffer and other 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.
wrappy
ISC
The ISC License

File diff suppressed because one or more lines are too long

15566
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "setup-kustomize",
"version": "0.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/io": "^1.0.2",
"@actions/tool-cache": "^1.3.3",
"@octokit/plugin-throttling": "^3.4.1",
"semver": "^7.3.2"
"@actions/github": "^6.0.0",
"@actions/io": "^1.1.1",
"@actions/tool-cache": "^2.0.1",
"@octokit/plugin-throttling": "^8.0.1",
"semver": "^7.5.4"
},
"devDependencies": {
"@types/jest": "^26.0.15",
"@types/node": "^15.0.2",
"@types/semver": "^7.3.4",
"@typescript-eslint/parser": "^4.8.1",
"@vercel/ncc": "^0.25.1",
"eslint": "^7.17.0",
"eslint-plugin-github": "^4.1.1",
"eslint-plugin-jest": "^24.1.3",
"jest": "^26.6.3",
"jest-circus": "^26.6.3",
"js-yaml": "^3.14.0",
"prettier": "2.2.1",
"ts-jest": "^26.4.4",
"typescript": "^4.1.3"
"@types/jest": "^29.5.6",
"@types/node": "^20.8.8",
"@types/semver": "^7.3.9",
"@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": "^3.0.3",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
}
}

View File

@@ -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'
@@ -11,6 +11,7 @@ let tempDirectory = process.env['RUNNER_TEMPDIRECTORY'] || ''
const EnhancedOctokit = GitHub.plugin(throttling)
const githubToken = core.getInput('github-token')
const failFast = core.getBooleanInput('fail-fast')
let options: OctokitOptions = {
throttle: {
@@ -18,13 +19,17 @@ let options: OctokitOptions = {
core.warning(
`Request quota exhausted for request ${opts.method} ${opts.url}`
)
core.warning(`Retrying after ${retryAfter} seconds!`)
return true
if (!failFast) {
core.warning(`Retrying after ${retryAfter} seconds!`)
}
return !failFast
},
onAbuseLimit: (retryAfter: Number, opts: OctokitOptions) => {
onSecondaryRateLimit: (retryAfter: Number, opts: OctokitOptions) => {
core.warning(`Abuse detected for request ${opts.method} ${opts.url}`)
core.warning(`Retrying after ${retryAfter} seconds!`)
return true
if (!failFast) {
core.warning(`Retrying after ${retryAfter} seconds!`)
}
return !failFast
}
}
}
@@ -60,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)
}
@@ -76,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> {
@@ -83,10 +141,11 @@ 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'
repo: 'kustomize',
per_page: 100
}
)) {
for (const release of response.data) {
@@ -119,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}'.`
)
}
@@ -136,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}`)
}

View File

@@ -13,7 +13,7 @@ async function run(): Promise<void> {
await installer.getKustomize(version)
}
} catch (error) {
core.setFailed(error.message)
core.setFailed(`${error}`)
}
}