1

My gitlab-ci.yml contains follwing Lint code

stages:
  - build

build:
  stage: build
  script:
  - exit 1

When running, the job doesn't fail!

Running with gitlab-runner 13.10.0 (54944146)
Preparing the "shell" executor
Using Shell executor...
Preparing environment
Getting source from Git repository
Fetching changes with git depth set to 50...
Reinitialized existing Git repository
Checking out b70613dd
git-lfs/2.13.2 (GitHub; windows amd64; go 1.14.13; git fc664697)
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:03
$ exit 1
Cleaning up file based variables
00:03
Job succeeded

How to avoid having false successes while the job should fail.

Davide Madrisan
  • 1,969
  • 2
  • 14
  • 22
  • Does this answer your question? [Tests in Gitab CI pipeline marked as passed when 2 tests cases fail](https://stackoverflow.com/questions/69574208/tests-in-gitab-ci-pipeline-marked-as-passed-when-2-tests-cases-fail) – Adam Marshall Oct 29 '21 at 04:12
  • 1
    I have found a solution. The issue is in the powershell shell. When using powershell-core, the problem does no longer appear. I do not understand yet why powershell-5 (windows default) returns a false result. – Bart Peremans Oct 30 '21 at 06:57
  • Glad you solved it! I’ll withdraw my vote since it’s a slightly different issue than it seemed. By the way, you can post an answer to your own question so others know this particular issue has an answer if you’re interested. – Adam Marshall Oct 30 '21 at 13:39

1 Answers1

0

PowerShell 5 (the Windows default PS instance) returns a false result. When using PowerShell Core, the problem no longer appears.

karel
  • 5,489
  • 46
  • 45
  • 50