|
31 | 31 | run: | |
32 | 32 | git config --global --add safe.directory $GITHUB_WORKSPACE |
33 | 33 | git fetch origin ${{ github.event.pull_request.base.ref }} |
34 | | -
|
35 | | - # Check if .clang-tidy files were changed |
36 | | - CLANG_TIDY_CHANGED=$(git diff --name-only \ |
| 34 | + CHANGED_FILES=$(git diff --name-only \ |
37 | 35 | origin/${{ github.event.pull_request.base.ref }}...HEAD \ |
38 | | - -- '**/.clang-tidy' || true) |
39 | | -
|
40 | | - if [ -n "$CLANG_TIDY_CHANGED" ]; then |
41 | | - echo "::notice::.clang-tidy configuration changed, analyzing all source files" |
42 | | - # Find all source files in the repository (excluding specified directories) |
43 | | - CHANGED_FILES=$(find . -name "*.cpp" -o -name "*.hpp" -o -name "*.c" -o -name "*.h") |
44 | | - # Filter out excluded directories |
45 | | - for exclude_dir in ${{ inputs.exclude }}; do |
46 | | - CHANGED_FILES=$(echo "$CHANGED_FILES" | grep -v "^./${exclude_dir}/" || true) |
47 | | - done |
48 | | - else |
49 | | - # Only analyze changed source files |
50 | | - CHANGED_FILES=$(git diff --name-only \ |
51 | | - origin/${{ github.event.pull_request.base.ref }}...HEAD \ |
52 | | - -- '*.cpp' '*.hpp' '*.c' '*.h') |
53 | | - # Filter out excluded directories |
54 | | - for exclude_dir in ${{ inputs.exclude }}; do |
55 | | - CHANGED_FILES=$(echo "$CHANGED_FILES" | grep -v "^${exclude_dir}/" || true) |
56 | | - done |
57 | | - fi |
58 | | -
|
| 36 | + -- '*.cpp' '*.hpp' '*.c' '*.h' | grep -v '^${{ inputs.exclude }}/' || true) |
59 | 37 | echo "changed_files<<EOF" >> $GITHUB_OUTPUT |
60 | 38 | echo "$CHANGED_FILES" >> $GITHUB_OUTPUT |
61 | 39 | echo "EOF" >> $GITHUB_OUTPUT |
|
0 commit comments