Skip to content

Commit fa623c6

Browse files
committed
add git safe directory
1 parent 9c42bf6 commit fa623c6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/pr-code-format.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@ jobs:
2020
- name: Install clang-format
2121
run: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - && sudo apt-get install -y clang-format-18
2222

23+
- name: Add git safe directory
24+
run: git config --global --add safe.directory '*'
25+
# This command is used to address potential issues with Git's safe directory feature.
26+
# By setting '*' as a safe directory, we allow Git operations to proceed without errors
27+
# related to directory safety, ensuring smooth execution of the submodules updating.
28+
2329
- name: Run clang-format on changed files
2430
run: |
2531
# Get list of changed files
2632
CHANGED_FILES=$(git diff --name-only --diff-filter=ACM master...HEAD --)
2733
CHANGED_CPP_FILES = $(echo "$CHANGED_FILES" | grep -E '^(runtime-light|runtime-common)/.*\.(cpp|h|inl)$')
2834
29-
# Apply clang-format to each changed file
35+
# Apply clang-format to each changed source file
3036
echo "$CHANGED_CPP_FILES" | xargs -r clang-format-18 -style=file -i
3137
3238
- name: Check for formatting changes

0 commit comments

Comments
 (0)