Skip to content

Commit 7e985b1

Browse files
committed
updated summary
1 parent ebd0cf6 commit 7e985b1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

action.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ runs:
9393
# `steps.diktat.outputs.exit-code` variable.
9494
- id: diktat
9595
run: |
96-
set -x
96+
if [[ '${{ inputs.debug }}' == 'true' ]]
97+
then
98+
set -x
99+
fi
97100
DIKTAT_ARGS=('--config' '${{ inputs.config }}' '--reporter' '${{ inputs.reporter }}')
98101
if [[ '${{ inputs.reporter }}' == 'sarif' ]]
99102
then
@@ -116,7 +119,9 @@ runs:
116119
DIKTAT_CMD=${GITHUB_WORKSPACE}/diktat
117120
chmod +x ${DIKTAT_CMD}
118121
{ ${DIKTAT_CMD} "${DIKTAT_ARGS[@]}" "${INPUT_PATHS[@]}" | tee diktat.log; } && exit_code=$? || exit_code=$?
119-
echo "summary-line=$(tail -n1 diktat.log 2>/dev/null)" >>$GITHUB_OUTPUT
122+
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 + 1)) diktat.log 2>/dev/null)" >>$GITHUB_OUTPUT
120125
rm -f diktat.log
121126
echo "exit-code=${exit_code}" >>$GITHUB_OUTPUT
122127
env:

0 commit comments

Comments
 (0)