0

Pipeline yaml file is very simple: 1)make 2)run exe file.

The pipeline returns PASS even if exe file returns non-zero rc.

The rc is not even displayed in the job log.

How I check the execution return code and fail the pipeline ?

trigger:
- main
pool:
  vmImage: 'windows-latest'
steps:
- script: make
  displayName: '[step] make'
- script: main.exe
   displayName: '[step] execute main()'
  • Hi Pavel, welcome to Stack Overflow! Have you checked out similar questions before asking? Looks like this one might have an answer that fits your case: https://stackoverflow.com/questions/55194446/how-do-i-get-my-azure-devops-pipeline-build-to-fail-when-my-linting-script-retur – Nikolay Shebanov Dec 24 '20 at 12:57
  • Yes, I checked similar questions. Proposed solution with if [ $? -ne 0 ] didn't work (due to windows environment ?). But exit %errorlevel% works fine. – pavel levitsky Dec 24 '20 at 21:57

0 Answers0