Skip to content

GitLab CI: allow_failure:exit_codes does not behave as expected with powershell

Summary

GitLab CI: allow_failure:exit_codes does not behave as expected with powershell. The exit code is not taken into account and the job fails.

Steps to reproduce

The following job fails on powershell:

.gitlab-ci.yml
build:
    script:
        - exit 4
    allow_failure:
      exit_codes:
        - 4

Actual behavior

The job fails

Expected behavior

The job pass and a warning sign in shown in the pipeline

Note

  • On a bash runner, no issue
  • with allow_failure: true, no issue but exit code is not considered

Related issue

#28658 (closed)

Example repository

https://gitlab.com/mathieu.westphal/exit_codes-issue/

Edited by Mathieu Westphal