Skip to content

Commit

Permalink
Update clang-format PR check to not throw errors when files are removed
Browse files Browse the repository at this point in the history
  • Loading branch information
raccog committed Nov 3, 2023
1 parent 00d8dd7 commit d417254
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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~ --diff-filter=d | grep -E '.(c|cpp|h|hpp)$' | xargs`
echo "Changed files: $CHANGED_FILES"
[ -z "$CHANGED_FILES" ] && exit 0
clang-format -i $CHANGED_FILES
Expand Down

0 comments on commit d417254

Please sign in to comment.