diff --git a/.github/workflows/cppcheck-differential.yaml b/.github/workflows/cppcheck-differential.yaml index 2cd5011834463..efa44a66d9376 100644 --- a/.github/workflows/cppcheck-differential.yaml +++ b/.github/workflows/cppcheck-differential.yaml @@ -36,7 +36,7 @@ jobs: - name: Run Cppcheck on changed files run: | - files=$(cat changed_files.txt | grep '\.cpp$\|\.hpp$' | tr '\n' ' ') + files=$(cat changed_files.txt | grep -E '\.(cpp|hpp)$' || true) if [ -n "$files" ]; then echo "Running Cppcheck on changed files: $files" cppcheck --enable=all --inconclusive --check-level=exhaustive --suppressions-list=.cppcheck_suppressions --xml $files 2> cppcheck-report.xml