diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index ed483ef3f..ef0d43764 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -16,7 +16,7 @@ jobs: - name: clang-format run: | # Run clang-format - CHANGED_FILES=`git diff --name-only -r HEAD~ | grep -E '.(c|cpp|h|hpp)$' | xargs` + CHANGED_FILES=`git diff --name-only -r HEAD~ | grep -E '.(c|cpp|h|hpp)$' | xargs -I {} bash -c 'test -f "{}" && echo -n "{} "'` echo "Changed files: $CHANGED_FILES" [ -z "$CHANGED_FILES" ] && exit 0 clang-format -i $CHANGED_FILES