# GitLab CI: let a job keep running after a script step fails

## TL;DR

if a failed step must not kill the rest of the job, dont just chain with &&. For a job whose failure should not fail the pipeline, set allow_failure true on the job in .gitlab-ci.yml; the pipeline turns orange instead of red and downstream jobs still run. When you need finer control inside one job, capture the failure yourself: run the risky step as ./risky-step.sh || FAILED=true, then keep going, and at the end check the flag to decide what to do, like still uploading the HTML report artifact and still running docker rm for cleanup.

Use this when you run into the situation in the title.

**When not to use this skill:** unrelated tasks. It covers only the procedure above.

## Compatibility

Tool: GitLab. The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

## Details

That way the artifacts you need for debugging exist even when the step that produced them failed.
