Skip to content

Ensure after_script is called for cancelled and timed out pipelines

This issue was moved in another project.

Problem to Solve

It's possible to want a after_script step for a gitlab-ci.yml, where it's important that it always run. However, the current behavior of after_script is that if a build is canceled or times out the cleanup stage is skipped (even though this does not appear to be the original intent: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/102#note_11619214).

Proposal

Implement finally_script that is run in all cases, or make after_script run on cancel/timeout. Unless there are good design reasons for the current behavior of after_script to not run on cancel/timeout, this would be the preferred behavior.

Edited by Tim Poffenbarger