How to fail kotlin script that GH workflow will th...
# scripting
e
How to fail kotlin script that GH workflow will think it is failure? I used
Copy code
check(!nonEmptyReports)
It prints output but looks like exit code is still 0
Oke, looks like Clikt has the
ProgramResult
m
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:
Copy code
#!/usr/bin/env kotlin
check(false)
Running it:
Copy code
$ ./toto.main.kts
java.lang.IllegalStateException: Check failed.
$ echo $?
3
e
Thank you for checking!