From e897518f5d01770de48e57cb1490daa5d6438178 Mon Sep 17 00:00:00 2001 From: Evan Harvey Date: Tue, 25 Jan 2022 08:54:49 -0700 Subject: [PATCH] Fix bug in format check --- .github/workflows/format.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index e926e1817b..834add9314 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -22,8 +22,10 @@ jobs: # For every file changed, apply clang-format for file in $(git diff --name-only origin/$GITHUB_BASE_REF | egrep '.*\.cpp$|.*\.hpp$|.*\.h$'); do - clang-format-8 -i -style=file $file - git add $file + if [ -e $file ]; then + clang-format-8 -i -style=file $file + git add $file + fi done # If any diffs exist, error out