https://kotlinlang.org logo
Title
e

Eugen Martynov

04/25/2023, 11:13 AM
How to fail kotlin script that GH workflow will think it is failure? I used
check(!nonEmptyReports)
It prints output but looks like exit code is still 0
Oke, looks like Clikt has the
ProgramResult
m

mbonnin

05/01/2023, 2:20 PM
Interesting that uncaught exception return 0, I would have expected != 0
If you want something not using Clikt, I guess
_exitProcess_(1)
would work
Mmm it returns 3 for me:
#!/usr/bin/env kotlin
check(false)
Running it:
$ ./toto.main.kts
java.lang.IllegalStateException: Check failed.
$ echo $?
3
e

Eugen Martynov

05/15/2023, 12:09 PM
Thank you for checking!