Address eslint errors and warnings.

This commit is contained in:
Fabio Niephaus
2025-01-21 13:03:20 +01:00
committed by Fabio Niephaus
parent bc541ab008
commit af56e29ad9
15 changed files with 48 additions and 42 deletions

View File

@@ -46,7 +46,6 @@ async function saveCache(): Promise<void> {
* @returns Promise that will ignore error reported by the given promise
*/
async function ignoreErrors(promise: Promise<void>): Promise<unknown> {
/* eslint-disable github/no-then */
return new Promise(resolve => {
promise
.catch(error => {

View File

@@ -89,7 +89,7 @@ export async function findLatestEABuildDownloadUrl(
response = await getContents(ORACLE_GRAALVM_REPO_EA_BUILDS, filePath)
} catch (error) {
throw new Error(
`Unable to resolve download URL for '${javaEaVersion}'. Please make sure the java-version is set correctly. ${c.ERROR_HINT}`
`Unable to resolve download URL for '${javaEaVersion}' (reason: ${error}). Please make sure the java-version is set correctly. ${c.ERROR_HINT}`
)
}
if (

View File

@@ -1,6 +1,6 @@
import * as c from './constants'
import * as httpClient from '@actions/http-client'
import {downloadExtractAndCacheJDK, getLatestRelease} from './utils'
import {downloadExtractAndCacheJDK} from './utils'
import {downloadTool} from '@actions/tool-cache'
import {basename} from 'path'
@@ -11,7 +11,9 @@ const DISCO_API_BASE = 'https://api.foojay.io/disco/v3.0/packages/jdks'
interface JdkData {
message: string
/* eslint-disable @typescript-eslint/no-explicit-any */
result: any
/* eslint-enable @typescript-eslint/no-explicit-any */
}
export async function setUpMandrel(
@@ -22,7 +24,9 @@ export async function setUpMandrel(
let mandrelHome
switch (version) {
case '':
// fetch latest if no version is specified
// fetch latest if no version is specified
mandrelHome = await setUpMandrelLatest(javaVersion)
break
case 'latest':
mandrelHome = await setUpMandrelLatest(javaVersion)
break

View File

@@ -1,5 +1,4 @@
import * as core from '@actions/core'
import * as semver from 'semver'
import {execSync} from 'child_process'
import {existsSync} from 'fs'
import {VERSION_DEV} from './constants'