From 1bd3831e232aae93cddef2e504fc7f401b36ab72 Mon Sep 17 00:00:00 2001
From: Henri Menke <henri@henrimenke.de>
Date: Thu, 4 Jan 2024 12:45:05 +0100
Subject: [PATCH] ci: create patch when pre-commit hooks fail

---
 .gitlab-ci.yml | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bede632..9bcd94b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -73,7 +73,16 @@ style:
   script:
     - *prepare_style
     - pre-commit run --all-files
-
+  after_script:
+    - |
+      git diff --output=style.patch --exit-code || {
+         cat style.patch
+         false
+      }
+  artifacts:
+    when: on_failure
+    paths:
+      - style.patch
 
 test-bullseye:
   stage: test
-- 
GitLab