From 0681b347c2255b88c1ef4dde0e503c70d4c6396d Mon Sep 17 00:00:00 2001 From: Oluf Lorenzen Date: Thu, 15 Aug 2024 10:22:46 +0200 Subject: [PATCH] ci(prettier): show diff if prettier made changes The normal output is not helpful, see also: https://github.com/prettier/prettier/issues/6885 --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ec4288315e6713..4c748cb9a77262 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -260,7 +260,11 @@ jobs: key: prettier-main-cache - name: Lint - run: pnpm prettier --cache-location .cache/prettier + run: | + pnpm prettier --write --cache-location .cache/prettier || { + echo "[ERROR] Please apply the changes prettier suggests:" + git diff --color=always; exit 1; + } - name: Remove cache if: github.event_name == 'push'