Skip to content

Commit 9ed27ed

Browse files
committed
fixed a single line as summary
1 parent 874fc7c commit 9ed27ed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ runs:
120120
chmod +x ${DIKTAT_CMD}
121121
{ ${DIKTAT_CMD} "${DIKTAT_ARGS[@]}" "${INPUT_PATHS[@]}" | tee diktat.log; } && exit_code=$? || exit_code=$?
122122
total_lines=$(wc -l diktat.log | cut -d ' ' -f1)
123-
summary_line=$(grep -n 'Summary error count (descending) by rule:' diktat.log | cut -d: -f1)
124-
# echo "summary-line=$(tail -n $((total_lines - summary_line)) diktat.log 2>/dev/null)" >>$GITHUB_OUTPUT
125-
echo "summary-line=$(tail -n1 diktat.log 2>/dev/null)" >>$GITHUB_OUTPUT
123+
summary_line_number=$(grep -n 'Summary error count (descending) by rule:' diktat.log | cut -d: -f1)
124+
summary_line=$(tail -n $((total_lines - summary_line_number)) diktat.log | sed -e 's/^ //g' | awk '{ printf("%s,", $0) } END { printf "\n" }' | sed -e 's/,$//g')
125+
echo "summary-line=${summary_line} >>$GITHUB_OUTPUT
126126
rm -f diktat.log
127127
echo "exit-code=${exit_code}" >>$GITHUB_OUTPUT
128128
env:
@@ -156,7 +156,7 @@ runs:
156156
if (( ${{ steps.diktat.outputs.exit-code }} != 0 ))
157157
then
158158
echo '```console' >>${GITHUB_STEP_SUMMARY}
159-
echo "${{ steps.diktat.outputs.summary-line }}" >>${GITHUB_STEP_SUMMARY}
159+
${{ steps.diktat.outputs.summary-line }} | xargs -d ',' -n1 echo >>${GITHUB_STEP_SUMMARY}
160160
echo '```' >>${GITHUB_STEP_SUMMARY}
161161
fi
162162

0 commit comments

Comments
 (0)