mirror of
https://github.com/actions/setup-java.git
synced 2025-06-28 12:04:14 +00:00
fix: prevent default installation of JetBrains pre-releases
This commit is contained in:
parent
f4f1212c88
commit
f0dde7dc8c
3 changed files with 32 additions and 11 deletions
13
dist/setup/index.js
vendored
13
dist/setup/index.js
vendored
|
@ -129672,7 +129672,12 @@ class JetBrainsDistribution extends base_installer_1.JavaBase {
|
|||
// url is identical except page_index so print it once for debug
|
||||
core.debug(`Gathering available versions from '${rawUrl}'`);
|
||||
}
|
||||
const paginationPage = (yield this.http.getJson(rawUrl, requestHeaders)).result;
|
||||
const paginationPageResult = (yield this.http.getJson(rawUrl, requestHeaders)).result;
|
||||
if (!paginationPageResult || paginationPageResult.length === 0) {
|
||||
// break infinity loop because we have reached end of pagination
|
||||
break;
|
||||
}
|
||||
const paginationPage = paginationPageResult.filter(version => this.stable ? !version.prerelease : version.prerelease == true);
|
||||
if (!paginationPage || paginationPage.length === 0) {
|
||||
// break infinity loop because we have reached end of pagination
|
||||
break;
|
||||
|
@ -129680,9 +129685,11 @@ class JetBrainsDistribution extends base_installer_1.JavaBase {
|
|||
rawVersions.push(...paginationPage);
|
||||
page_index++;
|
||||
}
|
||||
if (this.stable) {
|
||||
// Add versions not available from the API but are downloadable
|
||||
const hidden = ['11_0_10b1145.115', '11_0_11b1341.60'];
|
||||
rawVersions.push(...hidden.map(tag => ({ tag_name: tag, name: tag })));
|
||||
rawVersions.push(...hidden.map(tag => ({ tag_name: tag, name: tag, prerelease: false })));
|
||||
}
|
||||
const versions0 = rawVersions.map((v) => __awaiter(this, void 0, void 0, function* () {
|
||||
var _a;
|
||||
// Release tags look like one of these:
|
||||
|
@ -129701,7 +129708,7 @@ class JetBrainsDistribution extends base_installer_1.JavaBase {
|
|||
.replace('-', '');
|
||||
const vsplit = vstring.split('b');
|
||||
let semver = vsplit[0];
|
||||
const build = +vsplit[1];
|
||||
const build = vsplit[1];
|
||||
// Normalize semver
|
||||
if (!semver.includes('.') && !semver.includes('_'))
|
||||
semver = `${semver}.0.0`;
|
||||
|
|
|
@ -113,9 +113,18 @@ export class JetBrainsDistribution extends JavaBase {
|
|||
core.debug(`Gathering available versions from '${rawUrl}'`);
|
||||
}
|
||||
|
||||
const paginationPage = (
|
||||
const paginationPageResult = (
|
||||
await this.http.getJson<IJetBrainsRawVersion[]>(rawUrl, requestHeaders)
|
||||
).result;
|
||||
if (!paginationPageResult || paginationPageResult.length === 0) {
|
||||
// break infinity loop because we have reached end of pagination
|
||||
break;
|
||||
}
|
||||
|
||||
const paginationPage: IJetBrainsRawVersion[] =
|
||||
paginationPageResult.filter(version =>
|
||||
this.stable ? !version.prerelease : version.prerelease == true
|
||||
);
|
||||
if (!paginationPage || paginationPage.length === 0) {
|
||||
// break infinity loop because we have reached end of pagination
|
||||
break;
|
||||
|
@ -125,9 +134,13 @@ export class JetBrainsDistribution extends JavaBase {
|
|||
page_index++;
|
||||
}
|
||||
|
||||
if (this.stable) {
|
||||
// Add versions not available from the API but are downloadable
|
||||
const hidden = ['11_0_10b1145.115', '11_0_11b1341.60'];
|
||||
rawVersions.push(...hidden.map(tag => ({tag_name: tag, name: tag})));
|
||||
rawVersions.push(
|
||||
...hidden.map(tag => ({tag_name: tag, name: tag, prerelease: false}))
|
||||
);
|
||||
}
|
||||
|
||||
const versions0 = rawVersions.map(async v => {
|
||||
// Release tags look like one of these:
|
||||
|
@ -148,7 +161,7 @@ export class JetBrainsDistribution extends JavaBase {
|
|||
|
||||
const vsplit = vstring.split('b');
|
||||
let semver = vsplit[0];
|
||||
const build = +vsplit[1];
|
||||
const build = vsplit[1];
|
||||
|
||||
// Normalize semver
|
||||
if (!semver.includes('.') && !semver.includes('_'))
|
||||
|
|
|
@ -3,11 +3,12 @@
|
|||
export interface IJetBrainsRawVersion {
|
||||
tag_name: string;
|
||||
name: string;
|
||||
prerelease: boolean;
|
||||
}
|
||||
|
||||
export interface IJetBrainsVersion {
|
||||
tag_name: string;
|
||||
semver: string;
|
||||
build: number;
|
||||
build: string;
|
||||
url: string;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue