File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
.github/actions/clang-tidy-native Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -77,15 +77,19 @@ runs:
77
77
while IFS= read -r file; do
78
78
if [ -n "$file" ] && [ -f "$file" ]; then
79
79
echo "Analyzing $file..."
80
+ FILE_OUTPUT=$(mktemp)
80
81
if clang-tidy-${{ inputs.clang_tidy_version }} "$file" \
81
82
-p ${{ inputs.build_dir }} --format-style=file 2>&1 | \
82
- tee -a "$COMMENTS_FILE"; then
83
- ISSUES=$(grep -c "warning:\|error:" "$COMMENTS_FILE" || echo "0")
84
- TOTAL_ISSUES=$((TOTAL_ISSUES + ISSUES))
83
+ tee "$FILE_OUTPUT"; then
84
+ ISSUES=$(grep -c "warning:\|error:" "$FILE_OUTPUT" 2>/dev/null || echo "0")
85
+ ISSUES=$(echo "$ISSUES" | tr -d '[:space:]')
86
+ TOTAL_ISSUES=$((TOTAL_ISSUES + ${ISSUES:-0}))
87
+ cat "$FILE_OUTPUT" >> "$COMMENTS_FILE"
85
88
else
86
89
echo "::error::Failed to analyze $file"
87
90
TOTAL_ISSUES=$((TOTAL_ISSUES + 1))
88
91
fi
92
+ rm -f "$FILE_OUTPUT"
89
93
fi
90
94
done <<< "${{ steps.changed-files.outputs.changed_files }}"
91
95
You can’t perform that action at this time.
0 commit comments