From 34a32f818e43751b0b76c526bb61081a26035fa3 Mon Sep 17 00:00:00 2001 From: Gregory Mitchell <54124162+gmitch215@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:37:49 -0600 Subject: [PATCH] Fix `semver` not resolving correctly --- dist/setup/index.js | 4 ++-- src/distributions/jetbrains/installer.ts | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 27fa97b..d1cef69 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -124639,7 +124639,7 @@ class JetBrainsDistribution extends base_installer_1.JavaBase { const url = `https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-${semver}-${platform}-${arch}-b${build}.tar.gz`; return { tag_name: tag, - semver: semver, + semver: semver.replace(/_/g, '.'), build: build, url: url }; @@ -124648,7 +124648,7 @@ class JetBrainsDistribution extends base_installer_1.JavaBase { core.startGroup('Print information about available versions'); console.timeEnd('Retrieving available versions for JBR took'); // eslint-disable-line no-console core.debug(`Available versions: [${versions.length}]`); - core.debug(versions.map(item => item.tag_name).join(', ')); + core.debug(versions.map(item => item.semver).join(', ')); core.endGroup(); } return versions; diff --git a/src/distributions/jetbrains/installer.ts b/src/distributions/jetbrains/installer.ts index 66e0e1c..5ab5c84 100644 --- a/src/distributions/jetbrains/installer.ts +++ b/src/distributions/jetbrains/installer.ts @@ -2,9 +2,8 @@ import * as core from '@actions/core'; import * as tc from '@actions/tool-cache'; import fs from 'fs'; -import path, {resolve} from 'path'; +import path from 'path'; import semver from 'semver'; -import https from 'https'; import {JavaBase} from '../base-installer'; import {IJetBrainsRawVersion, IJetBrainsVersion} from './models'; @@ -156,7 +155,7 @@ export class JetBrainsDistribution extends JavaBase { return { tag_name: tag, - semver: semver, + semver: semver.replace(/_/g, '.'), build: build, url: url } as IJetBrainsVersion; @@ -166,7 +165,7 @@ export class JetBrainsDistribution extends JavaBase { core.startGroup('Print information about available versions'); console.timeEnd('Retrieving available versions for JBR took'); // eslint-disable-line no-console core.debug(`Available versions: [${versions.length}]`); - core.debug(versions.map(item => item.tag_name).join(', ')); + core.debug(versions.map(item => item.semver).join(', ')); core.endGroup(); }