How to mark stage as unstable if Powershell condition results into true?

There is no such state as an “unstable” job in Gitlab CI. It either fails or succeeds.
To get the build still marked as failed (not “unstable”) inside your if clause even though your compiler is asked to not “fail” on warnings (so its return code will be just fine and you will have build artifacts) you can break the script intentionally with a failing line of code after scanning the return of your build for warnings. If you then want the other stages to try to execute even though the build gives a failed state, that is the already mentioned allow_failure: true.

1 Like