Compare commits

..

1 Commits

Author SHA1 Message Date
Chiranjib Swain
0756542bc5 Refactor error handling and improve test logging for installers (#989)
* Refactor error handling for version not found cases across multiple installers

* Mock core.error in tests to suppress error logs

* fix(graalvm): improve error messages for EA version not found scenarios

* refactor(tests): update error messages for version not found scenarios

* fix(graalvm): enhance error messages for version not found scenarios

* fix(graalvm): improve error messages for version not found scenarios with updated download URL

* fix(graalvm): improve error handling for EA version not found scenarios with clearer messages
2026-04-13 12:44:45 -05:00
68 changed files with 105237 additions and 47086 deletions

View File

@@ -13,5 +13,4 @@ allowed:
reviewed: reviewed:
npm: npm:
- "@actions/http-client" # MIT (license text present), but detected as "other" - "@actions/http-client" # MIT (license text present), but detected as "other"
- "argparse" # Python Software Foundation License (PSF), but detected as "other"

View File

@@ -1,6 +1,6 @@
--- ---
name: "@actions/cache" name: "@actions/cache"
version: 5.0.5 version: 5.0.1
type: npm type: npm
summary: Actions cache lib summary: Actions cache lib
homepage: https://github.com/actions/toolkit/tree/main/packages/cache homepage: https://github.com/actions/toolkit/tree/main/packages/cache

View File

@@ -0,0 +1,20 @@
---
name: "@actions/core"
version: 1.11.1
type: npm
summary: Actions core lib
homepage: https://github.com/actions/toolkit/tree/main/packages/core
license: mit
licenses:
- sources: LICENSE.md
text: |-
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.
notices: []

View File

@@ -1,6 +1,6 @@
--- ---
name: "@actions/core" name: "@actions/core"
version: 2.0.3 version: 2.0.1
type: npm type: npm
summary: Actions core lib summary: Actions core lib
homepage: https://github.com/actions/toolkit/tree/main/packages/core homepage: https://github.com/actions/toolkit/tree/main/packages/core

View File

@@ -0,0 +1,20 @@
---
name: "@actions/exec"
version: 1.1.1
type: npm
summary: Actions exec lib
homepage: https://github.com/actions/toolkit/tree/main/packages/exec
license: mit
licenses:
- sources: LICENSE.md
text: |-
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.
notices: []

View File

@@ -1,6 +1,6 @@
--- ---
name: "@actions/glob" name: "@actions/glob"
version: 0.5.1 version: 0.5.0
type: npm type: npm
summary: Actions glob lib summary: Actions glob lib
homepage: https://github.com/actions/toolkit/tree/main/packages/glob homepage: https://github.com/actions/toolkit/tree/main/packages/glob

View File

@@ -0,0 +1,32 @@
---
name: "@actions/http-client"
version: 2.2.3
type: npm
summary: Actions Http Client
homepage: https://github.com/actions/toolkit/tree/main/packages/http-client
license: other
licenses:
- sources: LICENSE
text: |
Actions Http Client for Node.js
Copyright (c) GitHub, Inc.
All rights reserved.
MIT License
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.
notices: []

20
.licenses/npm/@actions/io-1.1.3.dep.yml generated Normal file
View File

@@ -0,0 +1,20 @@
---
name: "@actions/io"
version: 1.1.3
type: npm
summary: Actions io lib
homepage: https://github.com/actions/toolkit/tree/main/packages/io
license: mit
licenses:
- sources: LICENSE.md
text: |-
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.
notices: []

View File

@@ -1,6 +1,6 @@
--- ---
name: "@actions/tool-cache" name: "@actions/tool-cache"
version: 3.0.1 version: 2.0.1
type: npm type: npm
summary: Actions tool-cache lib summary: Actions tool-cache lib
homepage: https://github.com/actions/toolkit/tree/main/packages/tool-cache homepage: https://github.com/actions/toolkit/tree/main/packages/tool-cache

30
.licenses/npm/@fastify/busboy.dep.yml generated Normal file
View File

@@ -0,0 +1,30 @@
---
name: "@fastify/busboy"
version: 2.1.0
type: npm
summary: A streaming parser for HTML form data for node.js
homepage:
license: mit
licenses:
- sources: LICENSE
text: |-
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.
notices: []

View File

@@ -1,6 +1,6 @@
--- ---
name: "@oozcitak/dom" name: "@oozcitak/dom"
version: 2.0.2 version: 1.15.8
type: npm type: npm
summary: A modern DOM implementation summary: A modern DOM implementation
homepage: http://github.com/oozcitak/dom homepage: http://github.com/oozcitak/dom

View File

@@ -1,6 +1,6 @@
--- ---
name: "@oozcitak/infra" name: "@oozcitak/infra"
version: 2.0.2 version: 1.0.8
type: npm type: npm
summary: An implementation of the Infra Living Standard summary: An implementation of the Infra Living Standard
homepage: http://github.com/oozcitak/infra homepage: http://github.com/oozcitak/infra

View File

@@ -1,6 +1,6 @@
--- ---
name: "@oozcitak/url" name: "@oozcitak/url"
version: 3.0.0 version: 1.0.4
type: npm type: npm
summary: An implementation of the URL Living Standard summary: An implementation of the URL Living Standard
homepage: http://github.com/oozcitak/url homepage: http://github.com/oozcitak/url

View File

@@ -1,6 +1,6 @@
--- ---
name: "@oozcitak/util" name: "@oozcitak/util"
version: 10.0.0 version: 8.3.8
type: npm type: npm
summary: Utility functions summary: Utility functions
homepage: http://github.com/oozcitak/util homepage: http://github.com/oozcitak/util

32
.licenses/npm/@types/node.dep.yml generated Normal file
View File

@@ -0,0 +1,32 @@
---
name: "@types/node"
version: 24.1.0
type: npm
summary: TypeScript definitions for node
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
license: mit
licenses:
- sources: LICENSE
text: |2
MIT License
Copyright (c) Microsoft Corporation.
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
notices: []

View File

@@ -1,265 +1,38 @@
--- ---
name: argparse name: argparse
version: 2.0.1 version: 1.0.10
type: npm type: npm
summary: CLI arguments parser. Native port of python's argparse. summary: Very powerful CLI arguments parser. Native port of argparse - python's options
homepage: parsing library
license: other homepage: https://github.com/nodeca/argparse#readme
license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE
text: | text: |
A. HISTORY OF THE SOFTWARE (The MIT License)
==========================
Python was created in the early 1990s by Guido van Rossum at Stichting Copyright (C) 2012 by Vitaly Puzrin
Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
as a successor of a language called ABC. Guido remains Python's
principal author, although it includes many contributions from others.
In 1995, Guido continued his work on Python at the Corporation for Permission is hereby granted, free of charge, to any person obtaining a copy
National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) of this software and associated documentation files (the "Software"), to deal
in Reston, Virginia where he released several versions of the in the Software without restriction, including without limitation the rights
software. 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:
In May 2000, Guido and the Python core development team moved to The above copyright notice and this permission notice shall be included in
BeOpen.com to form the BeOpen PythonLabs team. In October of the same all copies or substantial portions of the Software.
year, the PythonLabs team moved to Digital Creations, which became
Zope Corporation. In 2001, the Python Software Foundation (PSF, see
https://www.python.org/psf/) was formed, a non-profit organization
created specifically to own Python-related Intellectual Property.
Zope Corporation was a sponsoring member of the PSF.
All Python releases are Open Source (see http://www.opensource.org for THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
the Open Source Definition). Historically, most, but not all, Python IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
releases have also been GPL-compatible; the table below summarizes FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
the various releases. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
Release Derived Year Owner GPL- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
from compatible? (1) THE SOFTWARE.
- sources: README.md
0.9.0 thru 1.2 1991-1995 CWI yes text: |-
1.3 thru 1.5.2 1.2 1995-1999 CNRI yes Copyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin).
1.6 1.5.2 2000 CNRI no Released under the MIT license. See
2.0 1.6 2000 BeOpen.com no [LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details.
1.6.1 1.6 2001 CNRI yes (2)
2.1 2.0+1.6.1 2001 PSF no
2.0.1 2.0+1.6.1 2001 PSF yes
2.1.1 2.1+2.0.1 2001 PSF yes
2.1.2 2.1.1 2002 PSF yes
2.1.3 2.1.2 2002 PSF yes
2.2 and above 2.1.1 2001-now PSF yes
Footnotes:
(1) GPL-compatible doesn't mean that we're distributing Python under
the GPL. All Python licenses, unlike the GPL, let you distribute
a modified version without making your changes open source. The
GPL-compatible licenses make it possible to combine Python with
other software that is released under the GPL; the others don't.
(2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
because its license has a choice of law clause. According to
CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
is "not incompatible" with the GPL.
Thanks to the many outside volunteers who have worked under Guido's
direction to make these releases possible.
B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
===============================================================
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.
2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation;
All Rights Reserved" are retained in Python alone or in any derivative version
prepared by Licensee.
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python.
4. PSF is making Python available to Licensee on an "AS IS"
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee. This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.
8. By copying, installing or otherwise using Python, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
-------------------------------------------
BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
Individual or Organization ("Licensee") accessing and otherwise using
this software in source or binary form and its associated
documentation ("the Software").
2. Subject to the terms and conditions of this BeOpen Python License
Agreement, BeOpen hereby grants Licensee a non-exclusive,
royalty-free, world-wide license to reproduce, analyze, test, perform
and/or display publicly, prepare derivative works, distribute, and
otherwise use the Software alone or in any derivative version,
provided, however, that the BeOpen Python License is retained in the
Software, alone or in any derivative version prepared by Licensee.
3. BeOpen is making the Software available to Licensee on an "AS IS"
basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
5. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
6. This License Agreement shall be governed by and interpreted in all
respects by the law of the State of California, excluding conflict of
law provisions. Nothing in this License Agreement shall be deemed to
create any relationship of agency, partnership, or joint venture
between BeOpen and Licensee. This License Agreement does not grant
permission to use BeOpen trademarks or trade names in a trademark
sense to endorse or promote products or services of Licensee, or any
third party. As an exception, the "BeOpen Python" logos available at
http://www.pythonlabs.com/logos.html may be used according to the
permissions granted on that web page.
7. By copying, installing or otherwise using the software, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
---------------------------------------
1. This LICENSE AGREEMENT is between the Corporation for National
Research Initiatives, having an office at 1895 Preston White Drive,
Reston, VA 20191 ("CNRI"), and the Individual or Organization
("Licensee") accessing and otherwise using Python 1.6.1 software in
source or binary form and its associated documentation.
2. Subject to the terms and conditions of this License Agreement, CNRI
hereby grants Licensee a nonexclusive, royalty-free, world-wide
license to reproduce, analyze, test, perform and/or display publicly,
prepare derivative works, distribute, and otherwise use Python 1.6.1
alone or in any derivative version, provided, however, that CNRI's
License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
1995-2001 Corporation for National Research Initiatives; All Rights
Reserved" are retained in Python 1.6.1 alone or in any derivative
version prepared by Licensee. Alternately, in lieu of CNRI's License
Agreement, Licensee may substitute the following text (omitting the
quotes): "Python 1.6.1 is made available subject to the terms and
conditions in CNRI's License Agreement. This Agreement together with
Python 1.6.1 may be located on the Internet using the following
unique, persistent identifier (known as a handle): 1895.22/1013. This
Agreement may also be obtained from a proxy server on the Internet
using the following URL: http://hdl.handle.net/1895.22/1013".
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python 1.6.1 or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python 1.6.1.
4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. This License Agreement shall be governed by the federal
intellectual property law of the United States, including without
limitation the federal copyright law, and, to the extent such
U.S. federal law does not apply, by the law of the Commonwealth of
Virginia, excluding Virginia's conflict of law provisions.
Notwithstanding the foregoing, with regard to derivative works based
on Python 1.6.1 that incorporate non-separable material that was
previously distributed under the GNU General Public License (GPL), the
law of the Commonwealth of Virginia shall govern this License
Agreement only as to issues arising under or with respect to
Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
License Agreement shall be deemed to create any relationship of
agency, partnership, or joint venture between CNRI and Licensee. This
License Agreement does not grant permission to use CNRI trademarks or
trade name in a trademark sense to endorse or promote products or
services of Licensee, or any third party.
8. By clicking on the "ACCEPT" button where indicated, or by copying,
installing or otherwise using Python 1.6.1, Licensee agrees to be
bound by the terms and conditions of this License Agreement.
ACCEPT
CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
--------------------------------------------------
Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
The Netherlands. All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission.
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
FOR ANY SPECIAL, 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.
notices: [] notices: []

View File

@@ -1,6 +1,6 @@
--- ---
name: brace-expansion name: brace-expansion
version: 1.1.13 version: 1.1.12
type: npm type: npm
summary: Brace expansion as known from sh/bash summary: Brace expansion as known from sh/bash
homepage: https://github.com/juliangruber/brace-expansion homepage: https://github.com/juliangruber/brace-expansion

32
.licenses/npm/esprima.dep.yml generated Normal file
View File

@@ -0,0 +1,32 @@
---
name: esprima
version: 4.0.1
type: npm
summary: ECMAScript parsing infrastructure for multipurpose analysis
homepage: http://esprima.org
license: bsd-2-clause
licenses:
- sources: LICENSE.BSD
text: |
Copyright JS Foundation and other contributors, https://js.foundation/
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* 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 <COPYRIGHT HOLDER> 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.
notices: []

View File

@@ -1,6 +1,6 @@
--- ---
name: fast-xml-builder name: fast-xml-builder
version: 1.1.4 version: 1.0.0
type: npm type: npm
summary: Build XML from JSON without C/C++ based libraries summary: Build XML from JSON without C/C++ based libraries
homepage: homepage:

View File

@@ -1,6 +1,6 @@
--- ---
name: fast-xml-parser name: fast-xml-parser
version: 5.5.10 version: 5.4.1
type: npm type: npm
summary: Validate XML, Parse XML, Build XML without C/C++ based libraries summary: Validate XML, Parse XML, Build XML without C/C++ based libraries
homepage: homepage:

View File

@@ -1,9 +1,9 @@
--- ---
name: js-yaml name: js-yaml
version: 4.1.1 version: 3.14.0
type: npm type: npm
summary: YAML 1.2 parser and serializer summary: YAML 1.2 parser and serializer
homepage: homepage: https://github.com/nodeca/js-yaml
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE

37
.licenses/npm/sprintf-js.dep.yml generated Normal file
View File

@@ -0,0 +1,37 @@
---
name: sprintf-js
version: 1.0.3
type: npm
summary: JavaScript sprintf implementation
homepage: https://github.com/alexei/sprintf.js#readme
license: bsd-3-clause
licenses:
- sources: LICENSE
text: |
Copyright (c) 2007-2014, Alexandru Marasteanu <hello [at) alexei (dot] ro>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* 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.
* Neither the name of this software nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
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 AUTHORS OR COPYRIGHT HOLDERS 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.
- sources: README.md
text: "**sprintf.js** is licensed under the terms of the 3-clause BSD license."
notices: []

View File

@@ -1,6 +1,6 @@
--- ---
name: strnum name: strnum
version: 2.2.3 version: 2.1.2
type: npm type: npm
summary: Parse String to Number based on configuration summary: Parse String to Number based on configuration
homepage: homepage:

View File

@@ -1,6 +1,6 @@
--- ---
name: undici name: undici
version: 6.24.1 version: 5.29.0
type: npm type: npm
summary: An HTTP/1.1 client, written from scratch for Node.js summary: An HTTP/1.1 client, written from scratch for Node.js
homepage: https://undici.nodejs.org homepage: https://undici.nodejs.org

View File

@@ -1,16 +1,16 @@
--- ---
name: path-expression-matcher name: undici
version: 1.4.0 version: 6.23.0
type: npm type: npm
summary: Efficient path tracking and pattern matching for XML/JSON parsers summary: An HTTP/1.1 client, written from scratch for Node.js
homepage: https://github.com/NaturalIntelligence/path-expression-matcher#readme homepage: https://undici.nodejs.org
license: mit license: mit
licenses: licenses:
- sources: LICENSE - sources: LICENSE
text: | text: |
MIT License MIT License
Copyright (c) 2024 Copyright (c) Matteo Collina and Undici contributors
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -29,4 +29,6 @@ licenses:
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
- sources: README.md
text: MIT
notices: [] notices: []

32
.licenses/npm/undici-types.dep.yml generated Normal file
View File

@@ -0,0 +1,32 @@
---
name: undici-types
version: 7.8.0
type: npm
summary: A stand-alone types package for Undici
homepage: https://undici.nodejs.org
license: mit
licenses:
- sources: LICENSE
text: |
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.
notices: []

39
.licenses/npm/uuid.dep.yml generated Normal file
View File

@@ -0,0 +1,39 @@
---
name: uuid
version: 3.4.0
type: npm
summary: RFC4122 (v1, v4, and v5) UUIDs
homepage: https://github.com/uuidjs/uuid#readme
license: mit
licenses:
- sources: LICENSE.md
text: |
The MIT License (MIT)
Copyright (c) 2010-2016 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.
notices:
- sources: AUTHORS
text: |-
Robert Kieffer <robert@broofa.com>
Christoph Tavan <dev@tavan.de>
AJ ONeal <coolaj86@gmail.com>
Vincent Voyer <vincent@zeroload.net>
Roman Shtylman <shtylman@gmail.com>

View File

@@ -1,12 +1,12 @@
--- ---
name: xmlbuilder2 name: xmlbuilder2
version: 4.0.3 version: 2.4.1
type: npm type: npm
summary: An XML builder for node.js summary: An XML builder for node.js
homepage: https://github.com/oozcitak/xmlbuilder2 homepage: http://github.com/oozcitak/xmlbuilder2
license: mit license: mit
licenses: licenses:
- sources: LICENSE.txt - sources: LICENSE
text: | text: |
MIT License MIT License

View File

@@ -17,6 +17,7 @@ describe('dependency cache', () => {
let spyWarning: jest.SpyInstance<void, Parameters<typeof core.warning>>; let spyWarning: jest.SpyInstance<void, Parameters<typeof core.warning>>;
let spyDebug: jest.SpyInstance<void, Parameters<typeof core.debug>>; let spyDebug: jest.SpyInstance<void, Parameters<typeof core.debug>>;
let spySaveState: jest.SpyInstance<void, Parameters<typeof core.saveState>>; let spySaveState: jest.SpyInstance<void, Parameters<typeof core.saveState>>;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
workspace = mkdtempSync(join(tmpdir(), 'setup-java-cache-')); workspace = mkdtempSync(join(tmpdir(), 'setup-java-cache-'));
@@ -51,6 +52,10 @@ describe('dependency cache', () => {
spySaveState = jest.spyOn(core, 'saveState'); spySaveState = jest.spyOn(core, 'saveState');
spySaveState.mockImplementation(() => null); spySaveState.mockImplementation(() => null);
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
afterEach(() => { afterEach(() => {
@@ -58,6 +63,10 @@ describe('dependency cache', () => {
process.env['GITHUB_WORKSPACE'] = ORIGINAL_GITHUB_WORKSPACE; process.env['GITHUB_WORKSPACE'] = ORIGINAL_GITHUB_WORKSPACE;
process.env['RUNNER_OS'] = ORIGINAL_RUNNER_OS; process.env['RUNNER_OS'] = ORIGINAL_RUNNER_OS;
resetState(); resetState();
jest.resetAllMocks();
jest.clearAllMocks();
jest.restoreAllMocks();
}); });
describe('restore', () => { describe('restore', () => {

View File

@@ -11,19 +11,32 @@ describe('cleanup', () => {
Parameters<typeof cache.saveCache> Parameters<typeof cache.saveCache>
>; >;
let spyJobStatusSuccess: jest.SpyInstance; let spyJobStatusSuccess: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
spyWarning = jest.spyOn(core, 'warning'); spyWarning = jest.spyOn(core, 'warning');
spyWarning.mockImplementation(() => null); spyWarning.mockImplementation(() => null);
spyInfo = jest.spyOn(core, 'info'); spyInfo = jest.spyOn(core, 'info');
spyInfo.mockImplementation(() => null); spyInfo.mockImplementation(() => null);
spyCacheSave = jest.spyOn(cache, 'saveCache'); spyCacheSave = jest.spyOn(cache, 'saveCache');
spyJobStatusSuccess = jest.spyOn(util, 'isJobStatusSuccess'); spyJobStatusSuccess = jest.spyOn(util, 'isJobStatusSuccess');
spyJobStatusSuccess.mockReturnValue(true); spyJobStatusSuccess.mockReturnValue(true);
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
createStateForSuccessfulRestore(); createStateForSuccessfulRestore();
}); });
afterEach(() => { afterEach(() => {
resetState(); resetState();
jest.resetAllMocks();
jest.clearAllMocks();
jest.restoreAllMocks();
}); });
it('does not fail nor warn even when the save process throws a ReserveCacheError', async () => { it('does not fail nor warn even when the save process throws a ReserveCacheError', async () => {

View File

@@ -9,9 +9,11 @@ import {JavaInstallerOptions} from '../../src/distributions/base-models';
import os from 'os'; import os from 'os';
import manifestData from '../data/adopt.json'; import manifestData from '../data/adopt.json';
import * as core from '@actions/core';
describe('getAvailableVersions', () => { describe('getAvailableVersions', () => {
let spyHttpClient: jest.SpyInstance; let spyHttpClient: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson'); spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -20,6 +22,10 @@ describe('getAvailableVersions', () => {
headers: {}, headers: {},
result: [] result: []
}); });
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
afterEach(() => { afterEach(() => {
@@ -262,7 +268,7 @@ describe('findPackageForDownload', () => {
distribution['getAvailableVersions'] = async () => manifestData as any; distribution['getAvailableVersions'] = async () => manifestData as any;
await expect( await expect(
distribution['findPackageForDownload']('9.0.8') distribution['findPackageForDownload']('9.0.8')
).rejects.toThrow(/Could not find satisfied version for SemVer */); ).rejects.toThrow(/No matching version found for SemVer */);
}); });
it('version is not found', async () => { it('version is not found', async () => {
@@ -277,7 +283,7 @@ describe('findPackageForDownload', () => {
); );
distribution['getAvailableVersions'] = async () => manifestData as any; distribution['getAvailableVersions'] = async () => manifestData as any;
await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrow( await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrow(
/Could not find satisfied version for SemVer */ /No matching version found for SemVer */
); );
}); });
@@ -293,7 +299,7 @@ describe('findPackageForDownload', () => {
); );
distribution['getAvailableVersions'] = async () => []; distribution['getAvailableVersions'] = async () => [];
await expect(distribution['findPackageForDownload']('11')).rejects.toThrow( await expect(distribution['findPackageForDownload']('11')).rejects.toThrow(
/Could not find satisfied version for SemVer */ /No matching version found for SemVer */
); );
}); });
}); });

View File

@@ -38,7 +38,7 @@ class EmptyJavaBase extends JavaBase {
): Promise<JavaDownloadRelease> { ): Promise<JavaDownloadRelease> {
const availableVersion = '11.0.9'; const availableVersion = '11.0.9';
if (!semver.satisfies(availableVersion, range)) { if (!semver.satisfies(availableVersion, range)) {
throw new Error('Available version not found'); throw this.createVersionNotFoundError(range, [availableVersion]);
} }
return { return {
@@ -248,6 +248,7 @@ describe('setupJava', () => {
let spyCoreExportVariable: jest.SpyInstance; let spyCoreExportVariable: jest.SpyInstance;
let spyCoreAddPath: jest.SpyInstance; let spyCoreAddPath: jest.SpyInstance;
let spyCoreSetOutput: jest.SpyInstance; let spyCoreSetOutput: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
spyGetToolcachePath = jest.spyOn(util, 'getToolcachePath'); spyGetToolcachePath = jest.spyOn(util, 'getToolcachePath');
@@ -287,6 +288,10 @@ describe('setupJava', () => {
spyCoreSetOutput = jest.spyOn(core, 'setOutput'); spyCoreSetOutput = jest.spyOn(core, 'setOutput');
spyCoreSetOutput.mockImplementation(() => undefined); spyCoreSetOutput.mockImplementation(() => undefined);
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => undefined);
jest.spyOn(os, 'arch').mockReturnValue('x86' as ReturnType<typeof os.arch>); jest.spyOn(os, 'arch').mockReturnValue('x86' as ReturnType<typeof os.arch>);
}); });
@@ -530,19 +535,16 @@ describe('setupJava', () => {
checkLatest: false checkLatest: false
} }
] ]
])( ])('should throw an error for version not found for %s', async input => {
'should throw an error for Available version not found for %s', mockJavaBase = new EmptyJavaBase(input);
async input => { await expect(mockJavaBase.setupJava()).rejects.toThrow(
mockJavaBase = new EmptyJavaBase(input); `No matching version found for SemVer '${input.version}'`
await expect(mockJavaBase.setupJava()).rejects.toThrow( );
'Available version not found' expect(spyTcFindAllVersions).toHaveBeenCalled();
); expect(spyCoreAddPath).not.toHaveBeenCalled();
expect(spyTcFindAllVersions).toHaveBeenCalled(); expect(spyCoreExportVariable).not.toHaveBeenCalled();
expect(spyCoreAddPath).not.toHaveBeenCalled(); expect(spyCoreSetOutput).not.toHaveBeenCalled();
expect(spyCoreExportVariable).not.toHaveBeenCalled(); });
expect(spyCoreSetOutput).not.toHaveBeenCalled();
}
);
}); });
describe('normalizeVersion', () => { describe('normalizeVersion', () => {
@@ -570,6 +572,97 @@ describe('normalizeVersion', () => {
}); });
}); });
describe('createVersionNotFoundError', () => {
it('should include all required fields in error message without available versions', () => {
const mockJavaBase = new EmptyJavaBase({
version: '17.0.5',
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
});
const error = (mockJavaBase as any).createVersionNotFoundError('17.0.5');
expect(error.message).toContain(
"No matching version found for SemVer '17.0.5'"
);
expect(error.message).toContain('Distribution: Empty');
expect(error.message).toContain('Package type: jdk');
expect(error.message).toContain('Architecture: x64');
});
it('should include available versions when provided', () => {
const mockJavaBase = new EmptyJavaBase({
version: '17.0.5',
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
});
const availableVersions = ['11.0.1', '11.0.2', '17.0.1', '17.0.2'];
const error = (mockJavaBase as any).createVersionNotFoundError(
'17.0.5',
availableVersions
);
expect(error.message).toContain(
"No matching version found for SemVer '17.0.5'"
);
expect(error.message).toContain('Distribution: Empty');
expect(error.message).toContain('Package type: jdk');
expect(error.message).toContain('Architecture: x64');
expect(error.message).toContain(
'Available versions: 11.0.1, 11.0.2, 17.0.1, 17.0.2'
);
});
it('should truncate available versions when there are many', () => {
const mockJavaBase = new EmptyJavaBase({
version: '17.0.5',
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
});
// Create 60 versions to test truncation
const availableVersions = Array.from({length: 60}, (_, i) => `11.0.${i}`);
const error = (mockJavaBase as any).createVersionNotFoundError(
'17.0.5',
availableVersions
);
expect(error.message).toContain('Available versions:');
expect(error.message).toContain('...');
expect(error.message).toContain('(showing first 50 of 60 versions');
});
it('should include additional context when provided', () => {
const mockJavaBase = new EmptyJavaBase({
version: '17.0.5',
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
});
const availableVersions = ['11.0.1', '11.0.2'];
const additionalContext = 'Platform: linux';
const error = (mockJavaBase as any).createVersionNotFoundError(
'17.0.5',
availableVersions,
additionalContext
);
expect(error.message).toContain(
"No matching version found for SemVer '17.0.5'"
);
expect(error.message).toContain('Distribution: Empty');
expect(error.message).toContain('Package type: jdk');
expect(error.message).toContain('Architecture: x64');
expect(error.message).toContain('Platform: linux');
expect(error.message).toContain('Available versions: 11.0.1, 11.0.2');
});
});
describe('getToolcacheVersionName', () => { describe('getToolcacheVersionName', () => {
const DummyJavaBase = JavaBase as any; const DummyJavaBase = JavaBase as any;

View File

@@ -4,13 +4,14 @@ import {JavaInstallerOptions} from '../../src/distributions/base-models';
import {CorrettoDistribution} from '../../src/distributions/corretto/installer'; import {CorrettoDistribution} from '../../src/distributions/corretto/installer';
import * as util from '../../src/util'; import * as util from '../../src/util';
import os from 'os'; import os from 'os';
import {isGeneratorFunction} from 'util/types'; import * as core from '@actions/core';
import manifestData from '../data/corretto.json'; import manifestData from '../data/corretto.json';
describe('getAvailableVersions', () => { describe('getAvailableVersions', () => {
let spyHttpClient: jest.SpyInstance; let spyHttpClient: jest.SpyInstance;
let spyGetDownloadArchiveExtension: jest.SpyInstance; let spyGetDownloadArchiveExtension: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson'); spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -23,6 +24,10 @@ describe('getAvailableVersions', () => {
util, util,
'getDownloadArchiveExtension' 'getDownloadArchiveExtension'
); );
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
afterEach(() => { afterEach(() => {
@@ -198,7 +203,7 @@ describe('getAvailableVersions', () => {
await expect( await expect(
distribution['findPackageForDownload'](version) distribution['findPackageForDownload'](version)
).rejects.toThrow("Could not find satisfied version for SemVer '4'"); ).rejects.toThrow("No matching version found for SemVer '4'");
}); });
it.each([ it.each([

View File

@@ -1,12 +1,14 @@
import {HttpClient} from '@actions/http-client'; import {HttpClient} from '@actions/http-client';
import {DragonwellDistribution} from '../../src/distributions/dragonwell/installer'; import {DragonwellDistribution} from '../../src/distributions/dragonwell/installer';
import * as utils from '../../src/util'; import * as utils from '../../src/util';
import * as core from '@actions/core';
import manifestData from '../data/dragonwell.json'; import manifestData from '../data/dragonwell.json';
describe('getAvailableVersions', () => { describe('getAvailableVersions', () => {
let spyHttpClient: jest.SpyInstance; let spyHttpClient: jest.SpyInstance;
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance; let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson'); spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -21,6 +23,10 @@ describe('getAvailableVersions', () => {
'getDownloadArchiveExtension' 'getDownloadArchiveExtension'
); );
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz'); spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
afterEach(() => { afterEach(() => {
@@ -232,7 +238,7 @@ describe('getAvailableVersions', () => {
await expect( await expect(
distribution['findPackageForDownload'](jdkVersion) distribution['findPackageForDownload'](jdkVersion)
).rejects.toThrow( ).rejects.toThrow(
`Couldn't find any satisfied version for the specified java-version: "${jdkVersion}" and architecture: "${arch}".` `No matching version found for SemVer '${jdkVersion}'`
); );
} }
); );

View File

@@ -42,6 +42,7 @@ beforeAll(() => {
describe('GraalVMDistribution', () => { describe('GraalVMDistribution', () => {
let distribution: GraalVMDistribution; let distribution: GraalVMDistribution;
let mockHttpClient: jest.Mocked<http.HttpClient>; let mockHttpClient: jest.Mocked<http.HttpClient>;
let spyCoreError: jest.SpyInstance;
const defaultOptions: JavaInstallerOptions = { const defaultOptions: JavaInstallerOptions = {
version: '17', version: '17',
@@ -59,6 +60,10 @@ describe('GraalVMDistribution', () => {
(distribution as any).http = mockHttpClient; (distribution as any).http = mockHttpClient;
(util.getDownloadArchiveExtension as jest.Mock).mockReturnValue('tar.gz'); (util.getDownloadArchiveExtension as jest.Mock).mockReturnValue('tar.gz');
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
afterAll(() => { afterAll(() => {
@@ -348,11 +353,19 @@ describe('GraalVMDistribution', () => {
} as http.HttpClientResponse; } as http.HttpClientResponse;
mockHttpClient.head.mockResolvedValue(mockResponse); mockHttpClient.head.mockResolvedValue(mockResponse);
// Verify the error is thrown with the expected message
await expect( await expect(
(distribution as any).findPackageForDownload('17.0.99') (distribution as any).findPackageForDownload('17.0.99')
).rejects.toThrow( ).rejects.toThrow("No matching version found for SemVer '17.0.99'");
'Could not find GraalVM for SemVer 17.0.99. Please check if this version is available at https://download.oracle.com/graalvm' // Verify distribution info is included
); await expect(
(distribution as any).findPackageForDownload('17.0.99')
).rejects.toThrow('GraalVM');
// Verify the hint about checking the base URL is included
await expect(
(distribution as any).findPackageForDownload('17.0.99')
).rejects.toThrow('https://www.graalvm.org/downloads/');
}); });
it('should throw error for unauthorized access (401)', async () => { it('should throw error for unauthorized access (401)', async () => {
@@ -496,12 +509,19 @@ describe('GraalVMDistribution', () => {
await expect( await expect(
(distribution as any).findPackageForDownload('23') (distribution as any).findPackageForDownload('23')
).rejects.toThrow("Unable to find latest version for '23-ea'"); ).rejects.toThrow("No matching version found for SemVer '23-ea'");
// Verify error logging await expect(
expect(core.error).toHaveBeenCalledWith( (distribution as any).findPackageForDownload('23')
'Available versions: 23-ea-20240716' ).rejects.toThrow(
'Note: No EA build is marked as latest for this version.'
); );
await expect(
(distribution as any).findPackageForDownload('23')
).rejects.toThrow('23-ea-20240716');
// Verify error logging - removed as we now use the helper method which doesn't call core.error
}); });
it('should throw error when no matching file for architecture in EA build', async () => { it('should throw error when no matching file for architecture in EA build', async () => {
@@ -708,11 +728,19 @@ describe('GraalVMDistribution', () => {
await expect( await expect(
(distribution as any).findEABuildDownloadUrl('23-ea') (distribution as any).findEABuildDownloadUrl('23-ea')
).rejects.toThrow("Unable to find latest version for '23-ea'"); ).rejects.toThrow("No matching version found for SemVer '23-ea'");
expect(core.error).toHaveBeenCalledWith( await expect(
'Available versions: 23-ea-20240716, 23-ea-20240709' (distribution as any).findEABuildDownloadUrl('23-ea')
).rejects.toThrow(
'Note: No EA build is marked as latest for this version.'
); );
await expect(
(distribution as any).findEABuildDownloadUrl('23-ea')
).rejects.toThrow('23-ea-20240716');
// Verify error logging - removed as we now use the helper method which doesn't call core.error
}); });
it('should throw error when no matching file for architecture', async () => { it('should throw error when no matching file for architecture', async () => {

View File

@@ -4,9 +4,11 @@ import {JetBrainsDistribution} from '../../src/distributions/jetbrains/installer
import manifestData from '../data/jetbrains.json'; import manifestData from '../data/jetbrains.json';
import os from 'os'; import os from 'os';
import * as core from '@actions/core';
describe('getAvailableVersions', () => { describe('getAvailableVersions', () => {
let spyHttpClient: jest.SpyInstance; let spyHttpClient: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson'); spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -15,6 +17,10 @@ describe('getAvailableVersions', () => {
headers: {}, headers: {},
result: [] result: []
}); });
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
afterEach(() => { afterEach(() => {
@@ -98,7 +104,7 @@ describe('findPackageForDownload', () => {
}); });
distribution['getAvailableVersions'] = async () => manifestData as any; distribution['getAvailableVersions'] = async () => manifestData as any;
await expect(distribution['findPackageForDownload']('8.x')).rejects.toThrow( await expect(distribution['findPackageForDownload']('8.x')).rejects.toThrow(
/Could not find satisfied version for SemVer */ /No matching version found for SemVer */
); );
}); });
@@ -111,7 +117,7 @@ describe('findPackageForDownload', () => {
}); });
distribution['getAvailableVersions'] = async () => []; distribution['getAvailableVersions'] = async () => [];
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow( await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
/Could not find satisfied version for SemVer */ /No matching version found for SemVer */
); );
}); });
}); });

View File

@@ -5,11 +5,13 @@ import {
} from '../../src/distributions/liberica/models'; } from '../../src/distributions/liberica/models';
import {HttpClient} from '@actions/http-client'; import {HttpClient} from '@actions/http-client';
import os from 'os'; import os from 'os';
import * as core from '@actions/core';
import manifestData from '../data/liberica.json'; import manifestData from '../data/liberica.json';
describe('getAvailableVersions', () => { describe('getAvailableVersions', () => {
let spyHttpClient: jest.SpyInstance; let spyHttpClient: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson'); spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -18,6 +20,10 @@ describe('getAvailableVersions', () => {
headers: {}, headers: {},
result: manifestData as LibericaVersion[] result: manifestData as LibericaVersion[]
}); });
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
afterEach(() => { afterEach(() => {
@@ -209,7 +215,7 @@ describe('findPackageForDownload', () => {
it('should throw an error', async () => { it('should throw an error', async () => {
await expect(distribution['findPackageForDownload']('17')).rejects.toThrow( await expect(distribution['findPackageForDownload']('17')).rejects.toThrow(
/Could not find satisfied version for semver */ /No matching version found for SemVer/
); );
}); });
}); });

View File

@@ -5,11 +5,13 @@ import {
} from '../../src/distributions/liberica/models'; } from '../../src/distributions/liberica/models';
import {HttpClient} from '@actions/http-client'; import {HttpClient} from '@actions/http-client';
import os from 'os'; import os from 'os';
import * as core from '@actions/core';
import manifestData from '../data/liberica-linux.json'; import manifestData from '../data/liberica-linux.json';
describe('getAvailableVersions', () => { describe('getAvailableVersions', () => {
let spyHttpClient: jest.SpyInstance; let spyHttpClient: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson'); spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -18,6 +20,10 @@ describe('getAvailableVersions', () => {
headers: {}, headers: {},
result: manifestData as LibericaVersion[] result: manifestData as LibericaVersion[]
}); });
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
afterEach(() => { afterEach(() => {
@@ -209,7 +215,7 @@ describe('findPackageForDownload', () => {
it('should throw an error', async () => { it('should throw an error', async () => {
await expect(distribution['findPackageForDownload']('18')).rejects.toThrow( await expect(distribution['findPackageForDownload']('18')).rejects.toThrow(
/Could not find satisfied version for semver */ /No matching version found for SemVer/
); );
}); });
}); });

View File

@@ -5,11 +5,13 @@ import {
} from '../../src/distributions/liberica/models'; } from '../../src/distributions/liberica/models';
import {HttpClient} from '@actions/http-client'; import {HttpClient} from '@actions/http-client';
import os from 'os'; import os from 'os';
import * as core from '@actions/core';
import manifestData from '../data/liberica-windows.json'; import manifestData from '../data/liberica-windows.json';
describe('getAvailableVersions', () => { describe('getAvailableVersions', () => {
let spyHttpClient: jest.SpyInstance; let spyHttpClient: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson'); spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -18,6 +20,9 @@ describe('getAvailableVersions', () => {
headers: {}, headers: {},
result: manifestData as LibericaVersion[] result: manifestData as LibericaVersion[]
}); });
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
afterEach(() => { afterEach(() => {
@@ -209,7 +214,7 @@ describe('findPackageForDownload', () => {
it('should throw an error', async () => { it('should throw an error', async () => {
await expect(distribution['findPackageForDownload']('18')).rejects.toThrow( await expect(distribution['findPackageForDownload']('18')).rejects.toThrow(
/Could not find satisfied version for semver */ /No matching version found for SemVer/
); );
}); });
}); });

View File

@@ -27,6 +27,7 @@ describe('setupJava', () => {
let spyFsReadDir: jest.SpyInstance; let spyFsReadDir: jest.SpyInstance;
let spyUtilsExtractJdkFile: jest.SpyInstance; let spyUtilsExtractJdkFile: jest.SpyInstance;
let spyPathResolve: jest.SpyInstance; let spyPathResolve: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
const expectedJdkFile = 'JavaLocalJdkFile'; const expectedJdkFile = 'JavaLocalJdkFile';
beforeEach(() => { beforeEach(() => {
@@ -93,6 +94,10 @@ describe('setupJava', () => {
// Spy on path methods // Spy on path methods
spyPathResolve = jest.spyOn(path, 'resolve'); spyPathResolve = jest.spyOn(path, 'resolve');
spyPathResolve.mockImplementation((path: string) => path); spyPathResolve.mockImplementation((path: string) => path);
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
afterEach(() => { afterEach(() => {

View File

@@ -8,6 +8,7 @@ describe('findPackageForDownload', () => {
let distribution: MicrosoftDistributions; let distribution: MicrosoftDistributions;
let spyGetManifestFromRepo: jest.SpyInstance; let spyGetManifestFromRepo: jest.SpyInstance;
let spyDebug: jest.SpyInstance; let spyDebug: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
distribution = new MicrosoftDistributions({ distribution = new MicrosoftDistributions({
@@ -26,6 +27,10 @@ describe('findPackageForDownload', () => {
spyDebug = jest.spyOn(core, 'debug'); spyDebug = jest.spyOn(core, 'debug');
spyDebug.mockImplementation(() => {}); spyDebug.mockImplementation(() => {});
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
it.each([ it.each([
@@ -174,7 +179,7 @@ describe('findPackageForDownload', () => {
it('should throw an error', async () => { it('should throw an error', async () => {
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow( await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
/Could not find satisfied version for SemVer */ /No matching version found for SemVer */
); );
}); });
}); });

View File

@@ -8,6 +8,7 @@ describe('findPackageForDownload', () => {
let distribution: OracleDistribution; let distribution: OracleDistribution;
let spyDebug: jest.SpyInstance; let spyDebug: jest.SpyInstance;
let spyHttpClient: jest.SpyInstance; let spyHttpClient: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
distribution = new OracleDistribution({ distribution = new OracleDistribution({
@@ -19,6 +20,10 @@ describe('findPackageForDownload', () => {
spyDebug = jest.spyOn(core, 'debug'); spyDebug = jest.spyOn(core, 'debug');
spyDebug.mockImplementation(() => {}); spyDebug.mockImplementation(() => {});
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
it.each([ it.each([

View File

@@ -1,12 +1,14 @@
import {HttpClient} from '@actions/http-client'; import {HttpClient} from '@actions/http-client';
import {SapMachineDistribution} from '../../src/distributions/sapmachine/installer'; import {SapMachineDistribution} from '../../src/distributions/sapmachine/installer';
import * as utils from '../../src/util'; import * as utils from '../../src/util';
import * as core from '@actions/core';
import manifestData from '../data/sapmachine.json'; import manifestData from '../data/sapmachine.json';
describe('getAvailableVersions', () => { describe('getAvailableVersions', () => {
let spyHttpClient: jest.SpyInstance; let spyHttpClient: jest.SpyInstance;
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance; let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson'); spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -21,6 +23,10 @@ describe('getAvailableVersions', () => {
'getDownloadArchiveExtension' 'getDownloadArchiveExtension'
); );
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz'); spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
afterEach(() => { afterEach(() => {
@@ -266,7 +272,7 @@ describe('getAvailableVersions', () => {
await expect( await expect(
distribution['findPackageForDownload'](normalizedVersion) distribution['findPackageForDownload'](normalizedVersion)
).rejects.toThrow( ).rejects.toThrow(
`Couldn't find any satisfied version for the specified java-version: "${normalizedVersion}" and architecture: "${arch}".` `No matching version found for SemVer '${normalizedVersion}'`
); );
} }
); );

View File

@@ -4,9 +4,11 @@ import {JavaInstallerOptions} from '../../src/distributions/base-models';
import {SemeruDistribution} from '../../src/distributions/semeru/installer'; import {SemeruDistribution} from '../../src/distributions/semeru/installer';
import manifestData from '../data/semeru.json'; import manifestData from '../data/semeru.json';
import * as core from '@actions/core';
describe('getAvailableVersions', () => { describe('getAvailableVersions', () => {
let spyHttpClient: jest.SpyInstance; let spyHttpClient: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson'); spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -15,6 +17,9 @@ describe('getAvailableVersions', () => {
headers: {}, headers: {},
result: [] result: []
}); });
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
afterEach(() => { afterEach(() => {
@@ -152,7 +157,7 @@ describe('findPackageForDownload', () => {
distribution['getAvailableVersions'] = async () => manifestData as any; distribution['getAvailableVersions'] = async () => manifestData as any;
await expect( await expect(
distribution['findPackageForDownload']('9.0.8') distribution['findPackageForDownload']('9.0.8')
).rejects.toThrow(/Could not find satisfied version for SemVer */); ).rejects.toThrow(/No matching version found for SemVer */);
}); });
it('version is not found', async () => { it('version is not found', async () => {
@@ -164,7 +169,7 @@ describe('findPackageForDownload', () => {
}); });
distribution['getAvailableVersions'] = async () => manifestData as any; distribution['getAvailableVersions'] = async () => manifestData as any;
await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrow( await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrow(
/Could not find satisfied version for SemVer */ /No matching version found for SemVer */
); );
}); });
@@ -177,7 +182,7 @@ describe('findPackageForDownload', () => {
}); });
distribution['getAvailableVersions'] = async () => []; distribution['getAvailableVersions'] = async () => [];
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow( await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
/Could not find satisfied version for SemVer */ /No matching version found for SemVer */
); );
}); });

View File

@@ -7,9 +7,11 @@ import {
import {JavaInstallerOptions} from '../../src/distributions/base-models'; import {JavaInstallerOptions} from '../../src/distributions/base-models';
import manifestData from '../data/temurin.json'; import manifestData from '../data/temurin.json';
import * as core from '@actions/core';
describe('getAvailableVersions', () => { describe('getAvailableVersions', () => {
let spyHttpClient: jest.SpyInstance; let spyHttpClient: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson'); spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -18,6 +20,9 @@ describe('getAvailableVersions', () => {
headers: {}, headers: {},
result: [] result: []
}); });
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
afterEach(() => { afterEach(() => {
@@ -213,7 +218,7 @@ describe('findPackageForDownload', () => {
distribution['getAvailableVersions'] = async () => manifestData as any; distribution['getAvailableVersions'] = async () => manifestData as any;
await expect( await expect(
distribution['findPackageForDownload']('9.0.8') distribution['findPackageForDownload']('9.0.8')
).rejects.toThrow(/Could not find satisfied version for SemVer */); ).rejects.toThrow(/No matching version found for SemVer */);
}); });
it('version is not found', async () => { it('version is not found', async () => {
@@ -228,7 +233,7 @@ describe('findPackageForDownload', () => {
); );
distribution['getAvailableVersions'] = async () => manifestData as any; distribution['getAvailableVersions'] = async () => manifestData as any;
await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrow( await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrow(
/Could not find satisfied version for SemVer */ /No matching version found for SemVer */
); );
}); });
@@ -244,7 +249,7 @@ describe('findPackageForDownload', () => {
); );
distribution['getAvailableVersions'] = async () => []; distribution['getAvailableVersions'] = async () => [];
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow( await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
/Could not find satisfied version for SemVer */ /No matching version found for SemVer */
); );
}); });
}); });

View File

@@ -3,12 +3,14 @@ import {ZuluDistribution} from '../../src/distributions/zulu/installer';
import {IZuluVersions} from '../../src/distributions/zulu/models'; import {IZuluVersions} from '../../src/distributions/zulu/models';
import * as utils from '../../src/util'; import * as utils from '../../src/util';
import os from 'os'; import os from 'os';
import * as core from '@actions/core';
import manifestData from '../data/zulu-releases-default.json'; import manifestData from '../data/zulu-releases-default.json';
describe('getAvailableVersions', () => { describe('getAvailableVersions', () => {
let spyHttpClient: jest.SpyInstance; let spyHttpClient: jest.SpyInstance;
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance; let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson'); spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -23,6 +25,10 @@ describe('getAvailableVersions', () => {
'getDownloadArchiveExtension' 'getDownloadArchiveExtension'
); );
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz'); spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
afterEach(() => { afterEach(() => {
@@ -225,6 +231,6 @@ describe('findPackageForDownload', () => {
distribution['getAvailableVersions'] = async () => manifestData; distribution['getAvailableVersions'] = async () => manifestData;
await expect( await expect(
distribution['findPackageForDownload'](distribution['version']) distribution['findPackageForDownload'](distribution['version'])
).rejects.toThrow(/Could not find satisfied version for semver */); ).rejects.toThrow(/No matching version found for SemVer/);
}); });
}); });

View File

@@ -4,12 +4,14 @@ import {ZuluDistribution} from '../../src/distributions/zulu/installer';
import {IZuluVersions} from '../../src/distributions/zulu/models'; import {IZuluVersions} from '../../src/distributions/zulu/models';
import * as utils from '../../src/util'; import * as utils from '../../src/util';
import os from 'os'; import os from 'os';
import * as core from '@actions/core';
import manifestData from '../data/zulu-linux.json'; import manifestData from '../data/zulu-linux.json';
describe('getAvailableVersions', () => { describe('getAvailableVersions', () => {
let spyHttpClient: jest.SpyInstance; let spyHttpClient: jest.SpyInstance;
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance; let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson'); spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -24,6 +26,10 @@ describe('getAvailableVersions', () => {
'getDownloadArchiveExtension' 'getDownloadArchiveExtension'
); );
spyUtilGetDownloadArchiveExtension.mockReturnValue('zip'); spyUtilGetDownloadArchiveExtension.mockReturnValue('zip');
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
afterEach(() => { afterEach(() => {
@@ -228,6 +234,6 @@ describe('findPackageForDownload', () => {
distribution['getAvailableVersions'] = async () => manifestData; distribution['getAvailableVersions'] = async () => manifestData;
await expect( await expect(
distribution['findPackageForDownload'](distribution['version']) distribution['findPackageForDownload'](distribution['version'])
).rejects.toThrow(/Could not find satisfied version for semver */); ).rejects.toThrow(/No matching version found for SemVer/);
}); });
}); });

View File

@@ -4,12 +4,14 @@ import {ZuluDistribution} from '../../src/distributions/zulu/installer';
import {IZuluVersions} from '../../src/distributions/zulu/models'; import {IZuluVersions} from '../../src/distributions/zulu/models';
import * as utils from '../../src/util'; import * as utils from '../../src/util';
import os from 'os'; import os from 'os';
import * as core from '@actions/core';
import manifestData from '../data/zulu-windows.json'; import manifestData from '../data/zulu-windows.json';
describe('getAvailableVersions', () => { describe('getAvailableVersions', () => {
let spyHttpClient: jest.SpyInstance; let spyHttpClient: jest.SpyInstance;
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance; let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
let spyCoreError: jest.SpyInstance;
beforeEach(() => { beforeEach(() => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson'); spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
@@ -24,6 +26,10 @@ describe('getAvailableVersions', () => {
'getDownloadArchiveExtension' 'getDownloadArchiveExtension'
); );
spyUtilGetDownloadArchiveExtension.mockReturnValue('zip'); spyUtilGetDownloadArchiveExtension.mockReturnValue('zip');
// Mock core.error to suppress error logs
spyCoreError = jest.spyOn(core, 'error');
spyCoreError.mockImplementation(() => {});
}); });
afterEach(() => { afterEach(() => {
@@ -226,6 +232,6 @@ describe('findPackageForDownload', () => {
distribution['getAvailableVersions'] = async () => manifestData; distribution['getAvailableVersions'] = async () => manifestData;
await expect( await expect(
distribution['findPackageForDownload'](distribution['version']) distribution['findPackageForDownload'](distribution['version'])
).rejects.toThrow(/Could not find satisfied version for semver */); ).rejects.toThrow(/No matching version found for SemVer/);
}); });
}); });

58346
dist/cleanup/index.js vendored

File diff suppressed because one or more lines are too long

92510
dist/setup/index.js vendored

File diff suppressed because one or more lines are too long

346
package-lock.json generated
View File

@@ -9,15 +9,15 @@
"version": "5.2.0", "version": "5.2.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/cache": "^5.0.5", "@actions/cache": "^5.0.1",
"@actions/core": "^2.0.3", "@actions/core": "^1.10.0",
"@actions/exec": "^2.0.0", "@actions/exec": "^1.0.4",
"@actions/glob": "^0.5.1", "@actions/glob": "^0.5.0",
"@actions/http-client": "^3.0.2", "@actions/http-client": "^2.2.3",
"@actions/io": "^2.0.0", "@actions/io": "^1.0.2",
"@actions/tool-cache": "^3.0.1", "@actions/tool-cache": "^2.0.1",
"semver": "^7.6.0", "semver": "^7.6.0",
"xmlbuilder2": "^4.0.3" "xmlbuilder2": "^2.4.0"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.14", "@types/jest": "^29.5.14",
@@ -50,15 +50,14 @@
} }
}, },
"node_modules/@actions/cache": { "node_modules/@actions/cache": {
"version": "5.0.5", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-5.0.5.tgz", "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-5.0.1.tgz",
"integrity": "sha512-jiQSg0gfd+C2KPgcmdCOq7dCuCIQQWQ4b1YfGIRaaA9w7PJbRwTOcCz4LiFEUnqZGf0ha/8OKL3BeNwetHzYsQ==", "integrity": "sha512-c+oH047Z2zmXLhjMZfEKjxZfv6Ou7T0sn5fhz6yupICXm5OOR47oZn5zxNO8MP7ttkxv5TOg3WsMrffri5Xhfw==",
"license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^2.0.0", "@actions/core": "^2.0.0",
"@actions/exec": "^2.0.0", "@actions/exec": "^2.0.0",
"@actions/glob": "^0.5.1", "@actions/glob": "^0.5.0",
"@actions/http-client": "^3.0.2", "@actions/http-client": "^3.0.0",
"@actions/io": "^2.0.0", "@actions/io": "^2.0.0",
"@azure/abort-controller": "^1.1.0", "@azure/abort-controller": "^1.1.0",
"@azure/core-rest-pipeline": "^1.22.0", "@azure/core-rest-pipeline": "^1.22.0",
@@ -67,25 +66,17 @@
"semver": "^6.3.1" "semver": "^6.3.1"
} }
}, },
"node_modules/@actions/cache/node_modules/semver": { "node_modules/@actions/cache/node_modules/@actions/core": {
"version": "6.3.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "resolved": "https://registry.npmjs.org/@actions/core/-/core-2.0.1.tgz",
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "integrity": "sha512-oBfqT3GwkvLlo1fjvhQLQxuwZCGTarTE5OuZ2Wg10hvhBj7LRIlF611WT4aZS6fDhO5ZKlY7lCAZTlpmyaHaeg==",
"bin": {
"semver": "bin/semver.js"
}
},
"node_modules/@actions/core": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-2.0.3.tgz",
"integrity": "sha512-Od9Thc3T1mQJYddvVPM4QGiLUewdh+3txmDYHHxoNdkqysR1MbCT+rFOtNUxYAz+7+6RIsqipVahY2GJqGPyxA==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/exec": "^2.0.0", "@actions/exec": "^2.0.0",
"@actions/http-client": "^3.0.2" "@actions/http-client": "^3.0.0"
} }
}, },
"node_modules/@actions/exec": { "node_modules/@actions/cache/node_modules/@actions/exec": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-2.0.0.tgz", "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-2.0.0.tgz",
"integrity": "sha512-k8ngrX2voJ/RIN6r9xB82NVqKpnMRtxDoiO+g3olkIUpQNqjArXrCQceduQZCQj3P3xm32pChRLqRrtXTlqhIw==", "integrity": "sha512-k8ngrX2voJ/RIN6r9xB82NVqKpnMRtxDoiO+g3olkIUpQNqjArXrCQceduQZCQj3P3xm32pChRLqRrtXTlqhIw==",
@@ -94,17 +85,7 @@
"@actions/io": "^2.0.0" "@actions/io": "^2.0.0"
} }
}, },
"node_modules/@actions/glob": { "node_modules/@actions/cache/node_modules/@actions/http-client": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.5.1.tgz",
"integrity": "sha512-+dv/t2aKQdKp9WWSp+1yIXVJzH5Q38M0Mta26pzIbeec14EcIleMB7UU6N7sNgbEuYfyuVGpE5pOKjl6j1WXkA==",
"license": "MIT",
"dependencies": {
"@actions/core": "^2.0.3",
"minimatch": "^3.0.4"
}
},
"node_modules/@actions/http-client": {
"version": "3.0.2", "version": "3.0.2",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-3.0.2.tgz", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-3.0.2.tgz",
"integrity": "sha512-JP38FYYpyqvUsz+Igqlc/JG6YO9PaKuvqjM3iGvaLqFnJ7TFmcLyy2IDrY0bI0qCQug8E9K+elv5ZNfw62ZJzA==", "integrity": "sha512-JP38FYYpyqvUsz+Igqlc/JG6YO9PaKuvqjM3iGvaLqFnJ7TFmcLyy2IDrY0bI0qCQug8E9K+elv5ZNfw62ZJzA==",
@@ -114,23 +95,82 @@
"undici": "^6.23.0" "undici": "^6.23.0"
} }
}, },
"node_modules/@actions/io": { "node_modules/@actions/cache/node_modules/@actions/io": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@actions/io/-/io-2.0.0.tgz", "resolved": "https://registry.npmjs.org/@actions/io/-/io-2.0.0.tgz",
"integrity": "sha512-Jv33IN09XLO+0HS79aaODsvIRyduiF7NY/F6LYeK5oeUmrsz7aFdRphQjFoESF4jS7lMauDOttKALcpapVDIAg==", "integrity": "sha512-Jv33IN09XLO+0HS79aaODsvIRyduiF7NY/F6LYeK5oeUmrsz7aFdRphQjFoESF4jS7lMauDOttKALcpapVDIAg==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/@actions/tool-cache": { "node_modules/@actions/cache/node_modules/semver": {
"version": "3.0.1", "version": "6.3.1",
"resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-3.0.1.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
"integrity": "sha512-euK7sID37jMg1yWGkdXkLPI5Te7x/+2QMUPeHXogcpzUZ81mqlDZ+CgYhQo3LtB8LpVnnQyjs+hTTU0Ir4Y0RQ==", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
"bin": {
"semver": "bin/semver.js"
}
},
"node_modules/@actions/cache/node_modules/undici": {
"version": "6.23.0",
"resolved": "https://registry.npmjs.org/undici/-/undici-6.23.0.tgz",
"integrity": "sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==",
"license": "MIT",
"engines": {
"node": ">=18.17"
}
},
"node_modules/@actions/core": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz",
"integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==",
"dependencies": {
"@actions/exec": "^1.1.1",
"@actions/http-client": "^2.0.1"
}
},
"node_modules/@actions/exec": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz",
"integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==",
"dependencies": {
"@actions/io": "^1.0.1"
}
},
"node_modules/@actions/glob": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.5.0.tgz",
"integrity": "sha512-tST2rjPvJLRZLuT9NMUtyBjvj9Yo0MiJS3ow004slMvm8GFM+Zv9HvMJ7HWzfUyJnGrJvDsYkWBaaG3YKXRtCw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^2.0.1", "@actions/core": "^1.9.1",
"@actions/exec": "^2.0.0", "minimatch": "^3.0.4"
"@actions/http-client": "^3.0.2", }
"@actions/io": "^2.0.0", },
"semver": "^6.1.0" "node_modules/@actions/http-client": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz",
"integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==",
"license": "MIT",
"dependencies": {
"tunnel": "^0.0.6",
"undici": "^5.25.4"
}
},
"node_modules/@actions/io": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="
},
"node_modules/@actions/tool-cache": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-2.0.1.tgz",
"integrity": "sha512-iPU+mNwrbA8jodY8eyo/0S/QqCKDajiR8OxWTnSk/SnYg0sj8Hp4QcUEVC1YFpHWXtrfbQrE13Jz4k4HXJQKcA==",
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/exec": "^1.0.0",
"@actions/http-client": "^2.0.1",
"@actions/io": "^1.1.1",
"semver": "^6.1.0",
"uuid": "^3.3.2"
} }
}, },
"node_modules/@actions/tool-cache/node_modules/semver": { "node_modules/@actions/tool-cache/node_modules/semver": {
@@ -997,6 +1037,14 @@
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
} }
}, },
"node_modules/@fastify/busboy": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz",
"integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==",
"engines": {
"node": ">=14"
}
},
"node_modules/@humanwhocodes/config-array": { "node_modules/@humanwhocodes/config-array": {
"version": "0.11.14", "version": "0.11.14",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
@@ -1501,51 +1549,47 @@
} }
}, },
"node_modules/@oozcitak/dom": { "node_modules/@oozcitak/dom": {
"version": "2.0.2", "version": "1.15.8",
"resolved": "https://registry.npmjs.org/@oozcitak/dom/-/dom-2.0.2.tgz", "resolved": "https://registry.npmjs.org/@oozcitak/dom/-/dom-1.15.8.tgz",
"integrity": "sha512-GjpKhkSYC3Mj4+lfwEyI1dqnsKTgwGy48ytZEhm4A/xnH/8z9M3ZVXKr/YGQi3uCLs1AEBS+x5T2JPiueEDW8w==", "integrity": "sha512-MoOnLBNsF+ok0HjpAvxYxR4piUhRDCEWK0ot3upwOOHYudJd30j6M+LNcE8RKpwfnclAX9T66nXXzkytd29XSw==",
"license": "MIT",
"dependencies": { "dependencies": {
"@oozcitak/infra": "^2.0.2", "@oozcitak/infra": "1.0.8",
"@oozcitak/url": "^3.0.0", "@oozcitak/url": "1.0.4",
"@oozcitak/util": "^10.0.0" "@oozcitak/util": "8.3.8"
}, },
"engines": { "engines": {
"node": ">=20.0" "node": ">=8.0"
} }
}, },
"node_modules/@oozcitak/infra": { "node_modules/@oozcitak/infra": {
"version": "2.0.2", "version": "1.0.8",
"resolved": "https://registry.npmjs.org/@oozcitak/infra/-/infra-2.0.2.tgz", "resolved": "https://registry.npmjs.org/@oozcitak/infra/-/infra-1.0.8.tgz",
"integrity": "sha512-2g+E7hoE2dgCz/APPOEK5s3rMhJvNxSMBrP+U+j1OWsIbtSpWxxlUjq1lU8RIsFJNYv7NMlnVsCuHcUzJW+8vA==", "integrity": "sha512-JRAUc9VR6IGHOL7OGF+yrvs0LO8SlqGnPAMqyzOuFZPSZSXI7Xf2O9+awQPSMXgIWGtgUf/dA6Hs6X6ySEaWTg==",
"license": "MIT",
"dependencies": { "dependencies": {
"@oozcitak/util": "^10.0.0" "@oozcitak/util": "8.3.8"
}, },
"engines": { "engines": {
"node": ">=20.0" "node": ">=6.0"
} }
}, },
"node_modules/@oozcitak/url": { "node_modules/@oozcitak/url": {
"version": "3.0.0", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/@oozcitak/url/-/url-3.0.0.tgz", "resolved": "https://registry.npmjs.org/@oozcitak/url/-/url-1.0.4.tgz",
"integrity": "sha512-ZKfET8Ak1wsLAiLWNfFkZc/BraDccuTJKR6svTYc7sVjbR+Iu0vtXdiDMY4o6jaFl5TW2TlS7jbLl4VovtAJWQ==", "integrity": "sha512-kDcD8y+y3FCSOvnBI6HJgl00viO/nGbQoCINmQ0h98OhnGITrWR3bOGfwYCthgcrV8AnTJz8MzslTQbC3SOAmw==",
"license": "MIT",
"dependencies": { "dependencies": {
"@oozcitak/infra": "^2.0.2", "@oozcitak/infra": "1.0.8",
"@oozcitak/util": "^10.0.0" "@oozcitak/util": "8.3.8"
}, },
"engines": { "engines": {
"node": ">=20.0" "node": ">=8.0"
} }
}, },
"node_modules/@oozcitak/util": { "node_modules/@oozcitak/util": {
"version": "10.0.0", "version": "8.3.8",
"resolved": "https://registry.npmjs.org/@oozcitak/util/-/util-10.0.0.tgz", "resolved": "https://registry.npmjs.org/@oozcitak/util/-/util-8.3.8.tgz",
"integrity": "sha512-hAX0pT/73190NLqBPPWSdBVGtbY6VOhWYK3qqHqtXQ1gK7kS2yz4+ivsN07hpJ6I3aeMtKP6J6npsEKOAzuTLA==", "integrity": "sha512-T8TbSnGsxo6TDBJx/Sgv/BlVJL3tshxZP7Aq5R1mSnM5OcHY2dQaxLMu2+E8u3gN0MLOzdjurqN4ZRVuzQycOQ==",
"license": "MIT",
"engines": { "engines": {
"node": ">=20.0" "node": ">=8.0"
} }
}, },
"node_modules/@protobuf-ts/runtime": { "node_modules/@protobuf-ts/runtime": {
@@ -1676,7 +1720,6 @@
"version": "24.1.0", "version": "24.1.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz",
"integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==", "integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==",
"dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"undici-types": "~7.8.0" "undici-types": "~7.8.0"
@@ -1892,11 +1935,10 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
"version": "2.0.3", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
"integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==", "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
"dev": true, "dev": true,
"license": "MIT",
"dependencies": { "dependencies": {
"balanced-match": "^1.0.0" "balanced-match": "^1.0.0"
} }
@@ -2112,7 +2154,8 @@
"node_modules/argparse": { "node_modules/argparse": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"dev": true
}, },
"node_modules/async": { "node_modules/async": {
"version": "3.2.6", "version": "3.2.6",
@@ -2243,10 +2286,9 @@
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
}, },
"node_modules/brace-expansion": { "node_modules/brace-expansion": {
"version": "1.1.13", "version": "1.1.12",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
"integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==", "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
"license": "MIT",
"dependencies": { "dependencies": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@@ -2869,7 +2911,6 @@
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true,
"bin": { "bin": {
"esparse": "bin/esparse.js", "esparse": "bin/esparse.js",
"esvalidate": "bin/esvalidate.js" "esvalidate": "bin/esvalidate.js"
@@ -3032,24 +3073,21 @@
"dev": true "dev": true
}, },
"node_modules/fast-xml-builder": { "node_modules/fast-xml-builder": {
"version": "1.1.4", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.1.4.tgz", "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.0.0.tgz",
"integrity": "sha512-f2jhpN4Eccy0/Uz9csxh3Nu6q4ErKxf0XIsasomfOihuSUa3/xw6w8dnOtCDgEItQFJG8KyXPzQXzcODDrrbOg==", "integrity": "sha512-fpZuDogrAgnyt9oDDz+5DBz0zgPdPZz6D4IR7iESxRXElrlGTRkHJ9eEt+SACRJwT0FNFrt71DFQIUFBJfX/uQ==",
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
"url": "https://github.com/sponsors/NaturalIntelligence" "url": "https://github.com/sponsors/NaturalIntelligence"
} }
], ],
"license": "MIT", "license": "MIT"
"dependencies": {
"path-expression-matcher": "^1.1.3"
}
}, },
"node_modules/fast-xml-parser": { "node_modules/fast-xml-parser": {
"version": "5.5.10", "version": "5.4.1",
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.5.10.tgz", "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.4.1.tgz",
"integrity": "sha512-go2J2xODMc32hT+4Xr/bBGXMaIoiCwrwp2mMtAvKyvEFW6S/v5Gn2pBmE4nvbwNjGhpcAiOwEv7R6/GZ6XRa9w==", "integrity": "sha512-BQ30U1mKkvXQXXkAGcuyUA/GA26oEB7NzOtsxCDtyu62sjGw5QraKFhx2Em3WQNjPw9PG6MQ9yuIIgkSDfGu5A==",
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
@@ -3058,9 +3096,8 @@
], ],
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"fast-xml-builder": "^1.1.4", "fast-xml-builder": "^1.0.0",
"path-expression-matcher": "^1.2.1", "strnum": "^2.1.2"
"strnum": "^2.2.2"
}, },
"bin": { "bin": {
"fxparser": "src/cli/cli.js" "fxparser": "src/cli/cli.js"
@@ -3107,11 +3144,10 @@
} }
}, },
"node_modules/filelist/node_modules/brace-expansion": { "node_modules/filelist/node_modules/brace-expansion": {
"version": "2.0.3", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
"integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==", "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
"dev": true, "dev": true,
"license": "MIT",
"dependencies": { "dependencies": {
"balanced-match": "^1.0.0" "balanced-match": "^1.0.0"
} }
@@ -3172,11 +3208,10 @@
} }
}, },
"node_modules/flatted": { "node_modules/flatted": {
"version": "3.4.2", "version": "3.2.9",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz",
"integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==",
"dev": true, "dev": true
"license": "ISC"
}, },
"node_modules/fs.realpath": { "node_modules/fs.realpath": {
"version": "1.0.0", "version": "1.0.0",
@@ -4180,6 +4215,7 @@
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
"dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"argparse": "^2.0.1" "argparse": "^2.0.1"
@@ -4561,21 +4597,6 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/path-expression-matcher": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.4.0.tgz",
"integrity": "sha512-s4DQMxIdhj3jLFWd9LxHOplj4p9yQ4ffMGowFf3cpEgrrJjEhN0V5nxw4Ye1EViAGDoL4/1AeO6qHpqYPOzE4Q==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/NaturalIntelligence"
}
],
"license": "MIT",
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/path-is-absolute": { "node_modules/path-is-absolute": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
@@ -4607,11 +4628,10 @@
"dev": true "dev": true
}, },
"node_modules/picomatch": { "node_modules/picomatch": {
"version": "2.3.2", "version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
"dev": true, "dev": true,
"license": "MIT",
"engines": { "engines": {
"node": ">=8.6" "node": ">=8.6"
}, },
@@ -5008,8 +5028,7 @@
"node_modules/sprintf-js": { "node_modules/sprintf-js": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="
"dev": true
}, },
"node_modules/stack-utils": { "node_modules/stack-utils": {
"version": "2.0.6", "version": "2.0.6",
@@ -5102,16 +5121,15 @@
} }
}, },
"node_modules/strnum": { "node_modules/strnum": {
"version": "2.2.3", "version": "2.1.2",
"resolved": "https://registry.npmjs.org/strnum/-/strnum-2.2.3.tgz", "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.1.2.tgz",
"integrity": "sha512-oKx6RUCuHfT3oyVjtnrmn19H1SiCqgJSg+54XqURKp5aCMbrXrhLjRN9TjuwMjiYstZ0MzDrHqkGZ5dFTKd+zg==", "integrity": "sha512-l63NF9y/cLROq/yqKXSLtcMeeyOfnSQlfMSlzFt/K73oIaD8DGaQWd7Z34X9GPiKqP5rbSh84Hl4bOlLcjiSrQ==",
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
"url": "https://github.com/sponsors/NaturalIntelligence" "url": "https://github.com/sponsors/NaturalIntelligence"
} }
], ]
"license": "MIT"
}, },
"node_modules/supports-color": { "node_modules/supports-color": {
"version": "7.2.0", "version": "7.2.0",
@@ -5310,19 +5328,20 @@
} }
}, },
"node_modules/undici": { "node_modules/undici": {
"version": "6.24.1", "version": "5.29.0",
"resolved": "https://registry.npmjs.org/undici/-/undici-6.24.1.tgz", "resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz",
"integrity": "sha512-sC+b0tB1whOCzbtlx20fx3WgCXwkW627p4EA9uM+/tNNPkSS+eSEld6pAs9nDv7WbY1UUljBMYPtu9BCOrCWKA==", "integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==",
"license": "MIT", "dependencies": {
"@fastify/busboy": "^2.0.0"
},
"engines": { "engines": {
"node": ">=18.17" "node": ">=14.0"
} }
}, },
"node_modules/undici-types": { "node_modules/undici-types": {
"version": "7.8.0", "version": "7.8.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
"integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==", "integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==",
"dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/update-browserslist-db": { "node_modules/update-browserslist-db": {
@@ -5364,6 +5383,15 @@
"punycode": "^2.1.0" "punycode": "^2.1.0"
} }
}, },
"node_modules/uuid": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
"deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.",
"bin": {
"uuid": "bin/uuid"
}
},
"node_modules/v8-to-istanbul": { "node_modules/v8-to-istanbul": {
"version": "9.1.3", "version": "9.1.3",
"resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz",
@@ -5439,18 +5467,38 @@
} }
}, },
"node_modules/xmlbuilder2": { "node_modules/xmlbuilder2": {
"version": "4.0.3", "version": "2.4.1",
"resolved": "https://registry.npmjs.org/xmlbuilder2/-/xmlbuilder2-4.0.3.tgz", "resolved": "https://registry.npmjs.org/xmlbuilder2/-/xmlbuilder2-2.4.1.tgz",
"integrity": "sha512-bx8Q1STctnNaaDymWnkfQLKofs0mGNN7rLLapJlGuV3VlvegD7Ls4ggMjE3aUSWItCCzU0PEv45lI87iSigiCA==", "integrity": "sha512-vliUplZsk5vJnhxXN/mRcij/AE24NObTUm/Zo4vkLusgayO6s3Et5zLEA14XZnY1c3hX5o1ToR0m0BJOPy0UvQ==",
"license": "MIT",
"dependencies": { "dependencies": {
"@oozcitak/dom": "^2.0.2", "@oozcitak/dom": "1.15.8",
"@oozcitak/infra": "^2.0.2", "@oozcitak/infra": "1.0.8",
"@oozcitak/util": "^10.0.0", "@oozcitak/util": "8.3.8",
"js-yaml": "^4.1.1" "@types/node": "*",
"js-yaml": "3.14.0"
}, },
"engines": { "engines": {
"node": ">=20.0" "node": ">=10.0"
}
},
"node_modules/xmlbuilder2/node_modules/argparse": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"dependencies": {
"sprintf-js": "~1.0.2"
}
},
"node_modules/xmlbuilder2/node_modules/js-yaml": {
"version": "3.14.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz",
"integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==",
"dependencies": {
"argparse": "^1.0.7",
"esprima": "^4.0.0"
},
"bin": {
"js-yaml": "bin/js-yaml.js"
} }
}, },
"node_modules/y18n": { "node_modules/y18n": {

View File

@@ -29,15 +29,15 @@
"author": "GitHub", "author": "GitHub",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/cache": "^5.0.5", "@actions/cache": "^5.0.1",
"@actions/core": "^2.0.3", "@actions/core": "^1.10.0",
"@actions/exec": "^2.0.0", "@actions/exec": "^1.0.4",
"@actions/glob": "^0.5.1", "@actions/glob": "^0.5.0",
"@actions/http-client": "^3.0.2", "@actions/http-client": "^2.2.3",
"@actions/io": "^2.0.0", "@actions/io": "^1.0.2",
"@actions/tool-cache": "^3.0.1", "@actions/tool-cache": "^2.0.1",
"semver": "^7.6.0", "semver": "^7.6.0",
"xmlbuilder2": "^4.0.3" "xmlbuilder2": "^2.4.0"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.14", "@types/jest": "^29.5.14",

View File

@@ -54,15 +54,10 @@ export class AdoptDistribution extends JavaBase {
const resolvedFullVersion = const resolvedFullVersion =
satisfiedVersions.length > 0 ? satisfiedVersions[0] : null; satisfiedVersions.length > 0 ? satisfiedVersions[0] : null;
if (!resolvedFullVersion) { if (!resolvedFullVersion) {
const availableOptions = availableVersionsWithBinaries const availableVersionStrings = availableVersionsWithBinaries.map(
.map(item => item.version) item => item.version
.join(', ');
const availableOptionsMessage = availableOptions
? `\nAvailable versions: ${availableOptions}`
: '';
throw new Error(
`Could not find satisfied version for SemVer '${version}'. ${availableOptionsMessage}`
); );
throw this.createVersionNotFoundError(version, availableVersionStrings);
} }
return resolvedFullVersion; return resolvedFullVersion;

View File

@@ -259,6 +259,42 @@ export abstract class JavaBase {
}; };
} }
protected createVersionNotFoundError(
versionOrRange: string,
availableVersions?: string[],
additionalContext?: string
): Error {
const parts = [
`No matching version found for SemVer '${versionOrRange}'.`,
`Distribution: ${this.distribution}`,
`Package type: ${this.packageType}`,
`Architecture: ${this.architecture}`
];
// Add additional context if provided (e.g., platform/OS info)
if (additionalContext) {
parts.push(additionalContext);
}
if (availableVersions && availableVersions.length > 0) {
const maxVersionsToShow = core.isDebug() ? availableVersions.length : 50;
const versionsToShow = availableVersions.slice(0, maxVersionsToShow);
const truncated = availableVersions.length > maxVersionsToShow;
parts.push(
`Available versions: ${versionsToShow.join(', ')}${truncated ? ', ...' : ''}`
);
if (truncated) {
parts.push(
`(showing first ${maxVersionsToShow} of ${availableVersions.length} versions, enable debug mode to see all)`
);
}
}
return new Error(parts.join('\n'));
}
protected setJavaDefault(version: string, toolPath: string) { protected setJavaDefault(version: string, toolPath: string) {
const majorVersion = version.split('.')[0]; const majorVersion = version.split('.')[0];
core.exportVariable('JAVA_HOME', toolPath); core.exportVariable('JAVA_HOME', toolPath);

View File

@@ -75,15 +75,10 @@ export class CorrettoDistribution extends JavaBase {
const resolvedVersion = const resolvedVersion =
matchingVersions.length > 0 ? matchingVersions[0] : null; matchingVersions.length > 0 ? matchingVersions[0] : null;
if (!resolvedVersion) { if (!resolvedVersion) {
const availableOptions = availableVersions const availableVersionStrings = availableVersions.map(
.map(item => item.version) item => item.version
.join(', ');
const availableOptionsMessage = availableOptions
? `\nAvailable versions: ${availableOptions}`
: '';
throw new Error(
`Could not find satisfied version for SemVer '${version}'. ${availableOptionsMessage}`
); );
throw this.createVersionNotFoundError(version, availableVersionStrings);
} }
return resolvedVersion; return resolvedVersion;
} }

View File

@@ -51,9 +51,10 @@ export class DragonwellDistribution extends JavaBase {
}); });
if (!matchedVersions.length) { if (!matchedVersions.length) {
throw new Error( const availableVersionStrings = availableVersions.map(
`Couldn't find any satisfied version for the specified java-version: "${version}" and architecture: "${this.architecture}".` item => item.jdk_version
); );
throw this.createVersionNotFoundError(version, availableVersionStrings);
} }
const resolvedVersion = matchedVersions[0]; const resolvedVersion = matchedVersions[0];

View File

@@ -18,6 +18,7 @@ import {
} from '../../util'; } from '../../util';
const GRAALVM_DL_BASE = 'https://download.oracle.com/graalvm'; const GRAALVM_DL_BASE = 'https://download.oracle.com/graalvm';
const GRAALVM_DOWNLOAD_URL = 'https://www.graalvm.org/downloads/';
const IS_WINDOWS = process.platform === 'win32'; const IS_WINDOWS = process.platform === 'win32';
const GRAALVM_PLATFORM = IS_WINDOWS ? 'windows' : process.platform; const GRAALVM_PLATFORM = IS_WINDOWS ? 'windows' : process.platform;
const GRAALVM_MIN_VERSION = 17; const GRAALVM_MIN_VERSION = 17;
@@ -149,9 +150,10 @@ export class GraalVMDistribution extends JavaBase {
const statusCode = response.message.statusCode; const statusCode = response.message.statusCode;
if (statusCode === HttpCodes.NotFound) { if (statusCode === HttpCodes.NotFound) {
throw new Error( // Create the standard error with additional hint about checking the download URL
`Could not find GraalVM for SemVer ${range}. Please check if this version is available at ${GRAALVM_DL_BASE}` const error = this.createVersionNotFoundError(range);
); error.message += `\nPlease check if this version is available at ${GRAALVM_DOWNLOAD_URL} . Pick a version from the list.`;
throw error;
} }
if ( if (
@@ -180,10 +182,12 @@ export class GraalVMDistribution extends JavaBase {
const latestVersion = versions.find(v => v.latest); const latestVersion = versions.find(v => v.latest);
if (!latestVersion) { if (!latestVersion) {
core.error( const availableVersions = versions.map(v => v.version);
`Available versions: ${versions.map(v => v.version).join(', ')}` throw this.createVersionNotFoundError(
javaEaVersion,
availableVersions,
'Note: No EA build is marked as latest for this version.'
); );
throw new Error(`Unable to find latest version for '${javaEaVersion}'`);
} }
core.debug(`Latest version found: ${latestVersion.version}`); core.debug(`Latest version found: ${latestVersion.version}`);

View File

@@ -44,15 +44,10 @@ export class JetBrainsDistribution extends JavaBase {
const resolvedFullVersion = const resolvedFullVersion =
satisfiedVersions.length > 0 ? satisfiedVersions[0] : null; satisfiedVersions.length > 0 ? satisfiedVersions[0] : null;
if (!resolvedFullVersion) { if (!resolvedFullVersion) {
const availableOptions = versionsRaw const availableVersionStrings = versionsRaw.map(
.map(item => `${item.tag_name} (${item.semver}+${item.build})`) item => `${item.tag_name} (${item.semver}+${item.build})`
.join(', ');
const availableOptionsMessage = availableOptions
? `\nAvailable versions: ${availableOptions}`
: '';
throw new Error(
`Could not find satisfied version for SemVer '${range}'. ${availableOptionsMessage}`
); );
throw this.createVersionNotFoundError(range, availableVersionStrings);
} }
return resolvedFullVersion; return resolvedFullVersion;

View File

@@ -69,15 +69,10 @@ export class LibericaDistributions extends JavaBase {
.sort((a, b) => -semver.compareBuild(a.version, b.version))[0]; .sort((a, b) => -semver.compareBuild(a.version, b.version))[0];
if (!satisfiedVersion) { if (!satisfiedVersion) {
const availableOptions = availableVersions const availableVersionStrings = availableVersions.map(
.map(item => item.version) item => item.version
.join(', ');
const availableOptionsMessage = availableOptions
? `\nAvailable versions: ${availableOptions}`
: '';
throw new Error(
`Could not find satisfied version for semver ${range}. ${availableOptionsMessage}`
); );
throw this.createVersionNotFoundError(range, availableVersionStrings);
} }
return satisfiedVersion; return satisfiedVersion;

View File

@@ -76,11 +76,8 @@ export class MicrosoftDistributions extends JavaBase {
const foundRelease = await tc.findFromManifest(range, true, manifest, arch); const foundRelease = await tc.findFromManifest(range, true, manifest, arch);
if (!foundRelease) { if (!foundRelease) {
throw new Error( const availableVersionStrings = manifest.map(item => item.version);
`Could not find satisfied version for SemVer ${range}.\nAvailable versions: ${manifest throw this.createVersionNotFoundError(range, availableVersionStrings);
.map(item => item.version)
.join(', ')}`
);
} }
return { return {

View File

@@ -112,7 +112,7 @@ export class OracleDistribution extends JavaBase {
} }
} }
throw new Error(`Could not find Oracle JDK for SemVer ${range}`); throw this.createVersionNotFoundError(range);
} }
public getPlatform(platform: NodeJS.Platform = process.platform): OsVersions { public getPlatform(platform: NodeJS.Platform = process.platform): OsVersions {

View File

@@ -49,9 +49,10 @@ export class SapMachineDistribution extends JavaBase {
}); });
if (!matchedVersions.length) { if (!matchedVersions.length) {
throw new Error( const availableVersionStrings = availableVersions.map(
`Couldn't find any satisfied version for the specified java-version: "${version}" and architecture: "${this.architecture}".` item => item.version
); );
throw this.createVersionNotFoundError(version, availableVersionStrings);
} }
const resolvedVersion = matchedVersions[0]; const resolvedVersion = matchedVersions[0];

View File

@@ -79,14 +79,16 @@ export class SemeruDistribution extends JavaBase {
const resolvedFullVersion = const resolvedFullVersion =
satisfiedVersions.length > 0 ? satisfiedVersions[0] : null; satisfiedVersions.length > 0 ? satisfiedVersions[0] : null;
if (!resolvedFullVersion) { if (!resolvedFullVersion) {
const availableOptions = availableVersionsWithBinaries const availableVersionStrings = availableVersionsWithBinaries.map(
.map(item => item.version) item => item.version
.join(', '); );
const availableOptionsMessage = availableOptions // Include platform context to help users understand OS-specific version availability
? `\nAvailable versions: ${availableOptions}` // IBM Semeru builds are OS-specific, so platform info aids in troubleshooting
: ''; const platformContext = `Platform: ${process.platform}`;
throw new Error( throw this.createVersionNotFoundError(
`Could not find satisfied version for SemVer version '${version}' for your current OS version for ${this.architecture} architecture ${availableOptionsMessage}` version,
availableVersionStrings,
platformContext
); );
} }

View File

@@ -57,15 +57,10 @@ export class TemurinDistribution extends JavaBase {
const resolvedFullVersion = const resolvedFullVersion =
satisfiedVersions.length > 0 ? satisfiedVersions[0] : null; satisfiedVersions.length > 0 ? satisfiedVersions[0] : null;
if (!resolvedFullVersion) { if (!resolvedFullVersion) {
const availableOptions = availableVersionsWithBinaries const availableVersionStrings = availableVersionsWithBinaries.map(
.map(item => item.version) item => item.version
.join(', ');
const availableOptionsMessage = availableOptions
? `\nAvailable versions: ${availableOptions}`
: '';
throw new Error(
`Could not find satisfied version for SemVer '${version}'. ${availableOptionsMessage}`
); );
throw this.createVersionNotFoundError(version, availableVersionStrings);
} }
return resolvedFullVersion; return resolvedFullVersion;

View File

@@ -57,15 +57,10 @@ export class ZuluDistribution extends JavaBase {
const resolvedFullVersion = const resolvedFullVersion =
satisfiedVersions.length > 0 ? satisfiedVersions[0] : null; satisfiedVersions.length > 0 ? satisfiedVersions[0] : null;
if (!resolvedFullVersion) { if (!resolvedFullVersion) {
const availableOptions = availableVersions const availableVersionStrings = availableVersions.map(
.map(item => item.version) item => item.version
.join(', ');
const availableOptionsMessage = availableOptions
? `\nAvailable versions: ${availableOptions}`
: '';
throw new Error(
`Could not find satisfied version for semver ${version}. ${availableOptionsMessage}`
); );
throw this.createVersionNotFoundError(version, availableVersionStrings);
} }
return resolvedFullVersion; return resolvedFullVersion;