]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Run CI danger job even if user canceled it while it was running
authorPetr Špaček <pspacek@isc.org>
Wed, 28 May 2025 13:46:14 +0000 (15:46 +0200)
committerPetr Špaček <pspacek@isc.org>
Mon, 2 Jun 2025 11:53:21 +0000 (11:53 +0000)
Limitation: The after_script is not executed if the job did not start at
all, i.e. if the user canceled the job before it got onto a runner.
See https://gitlab.com/groups/gitlab-org/-/epics/10158

(cherry picked from commit 33bc2628b78dd0a91c1ff644184628b184118588)

.gitlab-ci.yml

index 0811fe73c91c100fbfa00b84a74b39e9a7a02292..47c824e21d12343b09d5c41f3a2266604a2d9d9f 100644 (file)
@@ -676,6 +676,10 @@ danger:
   script:
     - pip install git+https://gitlab.isc.org/isc-projects/hazard.git
     - hazard
+  after_script:
+    # insist on running danger job even if user canceled it while it was running
+    - test "$CI_JOB_STATUS" != "canceled" && exit 0
+    - !reference [danger, script]
   rules:
     - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'