File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 93
93
# `steps.diktat.outputs.exit-code` variable.
94
94
- id : diktat
95
95
run : |
96
- set -x
96
+ if [[ '${{ inputs.debug }}' == 'true' ]]
97
+ then
98
+ set -x
99
+ fi
97
100
DIKTAT_ARGS=('--config' '${{ inputs.config }}' '--reporter' '${{ inputs.reporter }}')
98
101
if [[ '${{ inputs.reporter }}' == 'sarif' ]]
99
102
then
@@ -116,7 +119,9 @@ runs:
116
119
DIKTAT_CMD=${GITHUB_WORKSPACE}/diktat
117
120
chmod +x ${DIKTAT_CMD}
118
121
{ ${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
120
125
rm -f diktat.log
121
126
echo "exit-code=${exit_code}" >>$GITHUB_OUTPUT
122
127
env :
You can’t perform that action at this time.
0 commit comments