Exit code of a pipeline script is always 1 regardless of the exit code of the failed command
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
In a linting job, the linting program emits different exit codes depending on the encountered error. We want to specifically ignore the exit code that corresponds to the linter thinking the linted code has some mistakes (as opposed to the linter experiencing a failure while linting).
However, the gitlab CI job always exits with ERROR: Job failed: exit code 1, so the allow_failure:exit_codes directive does not work.
Steps to reproduce
- Specify a script that runs a command that returns a return code >= 2
Example Project
https://gitlab.com/repsak/debug-ci-failure/-/tree/main?ref_type=heads
What is the current bug behavior?
The job fails with exit code 1
What is the expected correct behavior?
The job fails with the exit code that the command returns
Output of checks
This bug happens on GitLab.com
Edited by 🤖 GitLab Bot 🤖