From 463f8f2dedcbedb828b88b89831da6b79506aa80 Mon Sep 17 00:00:00 2001
From: Oluf Lorenzen <fink.github.com@mafia-server.net>
Date: Mon, 19 Aug 2024 15:16:46 +0200
Subject: [PATCH] ci(prettier): show diff if prettier made changes (#30798)

---
 .github/workflows/build.yml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 78d5b977fd..b5472d32ce 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -260,7 +260,13 @@ jobs:
           key: prettier-main-cache
 
       - name: Lint
-        run: pnpm prettier --cache-location .cache/prettier
+        run: |
+          pnpm prettier --write --cache-location .cache/prettier
+          git diff --quiet || {
+            echo "[ERROR] Please apply the changes prettier suggests:"
+            git diff --color=always
+            exit 1
+          }
 
       - name: Remove cache
         if: github.event_name == 'push'
-- 
GitLab