mirror of
https://github.com/actions/setup-java.git
synced 2026-06-24 08:31:02 +03:00
- installer: surface a clear error when the GraalVM Community releases listing is not a JSON array, instead of silently treating an error payload (rate limit, auth failure, etc.) as "no releases" which later surfaced as a misleading "version not found" error. - docs: fix the GraalVM Community advanced-usage example to check the installed binary versions (java/native-image --version) rather than running a non-existent HelloWorldApp classpath that fails when copied. - tests: cover the new non-array release listing error path. Rebuilt dist bundle. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Vendored
+11
-1
@@ -79300,7 +79300,17 @@ class GraalVMCommunityDistribution extends GraalVMDistribution {
|
||||
let releasesUrl = GRAALVM_COMMUNITY_RELEASES_URL;
|
||||
for (let pageIndex = 0; releasesUrl && pageIndex < util_1.MAX_PAGINATION_PAGES; pageIndex++) {
|
||||
const response = yield this.http.getJson(releasesUrl, headers);
|
||||
const releases = Array.isArray(response.result) ? response.result : [];
|
||||
// A successful GitHub releases listing is always a JSON array (possibly
|
||||
// empty). Anything else indicates an unexpected/error payload (rate
|
||||
// limiting, auth failure, etc.) that must be surfaced instead of being
|
||||
// silently treated as "no releases", which would later look like a
|
||||
// misleading "version not found" error.
|
||||
if (!Array.isArray(response.result)) {
|
||||
throw new Error(`Unexpected response while listing GraalVM Community releases from ${releasesUrl} ` +
|
||||
`(HTTP status code: ${response.statusCode}). Expected a JSON array of releases. ` +
|
||||
`Please check if the service is available at ${GRAALVM_COMMUNITY_DOWNLOAD_URL}.`);
|
||||
}
|
||||
const releases = response.result;
|
||||
if (releases.length === 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user