Skip to content

Commit

Permalink
Merge c347d93 into c4c0efe
Browse files Browse the repository at this point in the history
  • Loading branch information
nulls authored Dec 25, 2023
2 parents c4c0efe + c347d93 commit c232e27
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,13 @@ runs:
DIKTAT_CMD=${GITHUB_WORKSPACE}/diktat
chmod +x ${DIKTAT_CMD}
{ ${DIKTAT_CMD} "${DIKTAT_ARGS[@]}" "${INPUT_PATHS[@]}" | tee diktat.log; } && exit_code=$? || exit_code=$?
total_lines=$(wc -l diktat.log | cut -d ' ' -f1)
summary_line_number=$(grep -n 'Summary error count (descending) by rule:' diktat.log | cut -d: -f1)
summary_line=$(tail -n $((total_lines - summary_line_number)) diktat.log | sed -e 's/^ //g' | awk '{ printf("%s,", $0) }' | sed -e 's/,$//g')
echo "summary-line=${summary_line}" >>$GITHUB_OUTPUT
if (( ${exit_code} != 0 ))
then
total_lines=$(wc -l diktat.log | cut -d ' ' -f1)
summary_line_number=$(grep -n 'Summary error count (descending) by rule:' diktat.log | cut -d: -f1)
summary_line=$(tail -n $((total_lines - summary_line_number)) diktat.log | sed -e 's/^ //g' | awk '{ printf("%s,", $0) }' | sed -e 's/,$//g')
echo "summary-line=${summary_line}" >>$GITHUB_OUTPUT
fi
rm -f diktat.log
echo "exit-code=${exit_code}" >>$GITHUB_OUTPUT
env:
Expand Down

0 comments on commit c232e27

Please sign in to comment.