diff --git a/dist/main.cjs b/dist/main.cjs index f5f030f..a310fc8 100644 --- a/dist/main.cjs +++ b/dist/main.cjs @@ -22392,12 +22392,11 @@ async function unzipArchive(archive, destination = __dirname2, deleteAfter = fal } async function run() { try { - const version2 = core.getInput("version", { required: false }) || (await (async () => { - const configVersion = await getVersionFromConfigFile(); - const availableVersions = await getAvailableVersions(); - const matchingVersion = findLatestMatchingVersion(availableVersions, configVersion); - return matchingVersion; - })() ?? "latest"); + const inputVersion = core.getInput("version", { required: false }); + const configVersion = await getVersionFromConfigFile(); + const availableVersions = await getAvailableVersions(); + const matchingVersion = findLatestMatchingVersion(availableVersions, configVersion); + const version2 = inputVersion || matchingVersion || "latest"; core.info(`Using Version: ${version2}`); const releaseURL = await getReleaseURL(version2); await downloadFile(releaseURL, path.join(__dirname2, "bwenv.zip")).then( diff --git a/src/main.ts b/src/main.ts index 337b4ca..5f3dd29 100644 --- a/src/main.ts +++ b/src/main.ts @@ -174,15 +174,13 @@ async function unzipArchive( async function run() { try { - const version = - core.getInput('version', { required: false }) || - ((await (async () => { - const configVersion = await getVersionFromConfigFile(); - const availableVersions = await getAvailableVersions(); - const matchingVersion = findLatestMatchingVersion(availableVersions, configVersion); - return matchingVersion; - })()) ?? - 'latest'); + const inputVersion = core.getInput('version', { required: false }); + + const configVersion = await getVersionFromConfigFile(); + const availableVersions = await getAvailableVersions(); + const matchingVersion = findLatestMatchingVersion(availableVersions, configVersion); + + const version = inputVersion || matchingVersion || 'latest'; core.info(`Using Version: ${version}`); @@ -198,6 +196,7 @@ async function run() { core.addPath(toolDir); } catch (error) { + // @ts-expect-error core.setFailed(error.message); } }