Skip to content

Commit

Permalink
add git safe directory
Browse files Browse the repository at this point in the history
  • Loading branch information
apolyakov committed Feb 4, 2025
1 parent 9c42bf6 commit fa623c6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/pr-code-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@ jobs:
- name: Install clang-format
run: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - && sudo apt-get install -y clang-format-18

- name: Add git safe directory
run: git config --global --add safe.directory '*'
# This command is used to address potential issues with Git's safe directory feature.
# By setting '*' as a safe directory, we allow Git operations to proceed without errors
# related to directory safety, ensuring smooth execution of the submodules updating.

- name: Run clang-format on changed files
run: |
# Get list of changed files
CHANGED_FILES=$(git diff --name-only --diff-filter=ACM master...HEAD --)
CHANGED_CPP_FILES = $(echo "$CHANGED_FILES" | grep -E '^(runtime-light|runtime-common)/.*\.(cpp|h|inl)$')
# Apply clang-format to each changed file
# Apply clang-format to each changed source file
echo "$CHANGED_CPP_FILES" | xargs -r clang-format-18 -style=file -i
- name: Check for formatting changes
Expand Down

0 comments on commit fa623c6

Please sign in to comment.