diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index dd28be5f238cb83fe5a91729a6e8577799d8e26e..cf2bf1c4f70871af495a3b04af54bab4b2ae9c10 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -36,7 +36,6 @@ stages:
   <<: *install-deps
   image: python:3.9-slim-bullseye
   stage: quality
-  allow_failure: true
 
 .test-template: &test
   <<: *install-deps
@@ -48,6 +47,21 @@ stages:
 run-pre-commit:
   <<: *quality
   script: make check
+  allow_failure: true
+  after_script:
+    - mkdir -pv changed
+    - |
+      test $CI_JOB_STATUS -eq "failed" &&
+      apt install git -y &&
+      git status --porcelain 
+        | awk 'match($1,"M"){print $2}' 
+        | xargs -r cp -vt changed
+  artifacts:
+    name: "$CI_JOB_NAME"
+    expire_in: 7 days
+    paths:
+      - "changed/*"
+    when: on_failure
 
 # Tests jobs