From c4c8b9934bdc955b96d19a21a2b19c4841734d72 Mon Sep 17 00:00:00 2001
From: Jan-Tarek Butt <tarek@ring0.de>
Date: Sat, 15 Jun 2024 19:28:54 +0200
Subject: [PATCH] .gitlab-ci.yml: add pipeline Demetion on sheduled skip

Signed-off-by: Jan-Tarek Butt <tarek@ring0.de>
---
 .gitlab-ci.yml | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 387b658..5eb3d8f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -126,7 +126,14 @@ cleanup:
   tags:
     - firmware
   script:
-    - if [ -f skip_pipeline ]; then exit 0; fi  # Exit the job if marker file exists
+    - |
+      (
+        if [ -f skip_pipeline ]; then 
+          # Delete the current pipeline
+          curl --request DELETE --header "PRIVATE-TOKEN: $ACCESS_TOKEN" "https://git.ffnw.de/api/v4/projects/$CI_PROJECT_ID/pipelines/$CI_PIPELINE_ID";
+          exit 0;
+        fi  # Exit the job if marker file exists
+      )
     - touch .patched
     - ./buildscript.sh clean_patches
     - rm -rf ../output
-- 
GitLab