From daaed1d2bdb1a30950b1b7451759a8e167b2c609 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Wed, 26 Mar 2025 10:44:50 +0000 Subject: [PATCH] Fix display of code changes in clang-format CI action Versions of `git-clang-format` later than 11 issue exit code 1 when changes were made to the source code. Although our CI job ended with a non-zero exit code as expected, it terminated early than wanted so that the differences are not printed to the log. --- .github/workflows/pull-request-check-clang-format.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-check-clang-format.sh b/.github/workflows/pull-request-check-clang-format.sh index 951b7e417ff..43d14e3e0b0 100755 --- a/.github/workflows/pull-request-check-clang-format.sh +++ b/.github/workflows/pull-request-check-clang-format.sh @@ -26,7 +26,7 @@ echo "Checking for formatting errors introduced since $MERGE_BASE" # Do the checking. "eval" is used so that quotes (as inserted into $EXCLUDES # above) are not interpreted as parts of file names. -eval git-clang-format-15 --binary clang-format-15 $MERGE_BASE -- $EXCLUDES +eval git-clang-format-15 --binary clang-format-15 $MERGE_BASE -- $EXCLUDES || true git diff > formatted.diff if [[ -s formatted.diff ]] ; then echo 'Formatting error! The following diff shows the required changes'