Fix TypeScript 6.0 compatibility errors in run.ts (#271)
Some checks failed
Run prettify / Prettier Check (push) Has been cancelled
Run unit tests. / build (macos-latest) (push) Has been cancelled
Run unit tests. / build (ubuntu-24.04-arm) (push) Has been cancelled
Run unit tests. / build (ubuntu-latest) (push) Has been cancelled
Run unit tests. / build (windows-11-arm) (push) Has been cancelled
Run unit tests. / build (windows-latest) (push) Has been cancelled

This commit is contained in:
David Gamero 2026-05-05 14:18:11 -04:00 committed by GitHub
parent 7202adf694
commit 3090233644
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -30,7 +30,7 @@ export async function run() {
core.endGroup()
try {
if (!process.env['PATH'].startsWith(path.dirname(cachedPath))) {
if (!process.env['PATH']?.startsWith(path.dirname(cachedPath))) {
core.addPath(path.dirname(cachedPath))
}
} catch {
@ -54,7 +54,7 @@ export async function getLatestHelmVersion(): Promise<string> {
return release
} catch (err) {
core.warning(
`Error while fetching latest Helm release: ${err.toString()}. Using default version ${stableHelmVersion}`
`Error while fetching latest Helm release: ${err instanceof Error ? err.message : String(err)}. Using default version ${stableHelmVersion}`
)
return stableHelmVersion
}