Exit from run k8s not allowing promise rejection (#65)

* Exit from run k8s not allowing promise rejection

* Unused case removed k8s
This commit is contained in:
Nikola Jokic
2023-02-14 11:30:16 +01:00
committed by GitHub
parent ae31f04223
commit d735152125

View File

@@ -9,7 +9,6 @@ import {
import { isAuthPermissionsOK, namespace, requiredPermissions } from './k8s'
async function run(): Promise<void> {
let exitCode = 0
try {
const input = await getInputFromStdin()
@@ -24,28 +23,28 @@ async function run(): Promise<void> {
)} on the pod resource in the '${namespace()}' namespace. Please contact your self hosted runner administrator.`
)
}
let exitCode = 0
switch (command) {
case Command.PrepareJob:
await prepareJob(args as prepareJobArgs, responseFile)
break
return process.exit(0)
case Command.CleanupJob:
await cleanupJob()
break
return process.exit(0)
case Command.RunScriptStep:
await runScriptStep(args, state, null)
break
return process.exit(0)
case Command.RunContainerStep:
exitCode = await runContainerStep(args)
break
case Command.runContainerStep:
return process.exit(exitCode)
default:
throw new Error(`Command not recognized: ${command}`)
}
} catch (error) {
core.error(error as Error)
exitCode = 1
process.exit(1)
}
process.exitCode = exitCode
}
void run()