Skip to content

Commit

Permalink
updated summary
Browse files Browse the repository at this point in the history
  • Loading branch information
nulls committed Dec 18, 2023
1 parent ebd0cf6 commit 7e985b1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ runs:
# `steps.diktat.outputs.exit-code` variable.
- id: diktat
run: |
set -x
if [[ '${{ inputs.debug }}' == 'true' ]]
then
set -x
fi
DIKTAT_ARGS=('--config' '${{ inputs.config }}' '--reporter' '${{ inputs.reporter }}')
if [[ '${{ inputs.reporter }}' == 'sarif' ]]
then
Expand All @@ -116,7 +119,9 @@ runs:
DIKTAT_CMD=${GITHUB_WORKSPACE}/diktat
chmod +x ${DIKTAT_CMD}
{ ${DIKTAT_CMD} "${DIKTAT_ARGS[@]}" "${INPUT_PATHS[@]}" | tee diktat.log; } && exit_code=$? || exit_code=$?
echo "summary-line=$(tail -n1 diktat.log 2>/dev/null)" >>$GITHUB_OUTPUT
total_lines=$(wc -l diktat.log | cut -d ' ' -f1)
summary_line=$(grep -n 'Summary error count (descending) by rule:' diktat.log | cut -d: -f1)
echo "summary-line=$(tail -n $((total_lines - summary_line + 1)) diktat.log 2>/dev/null)" >>$GITHUB_OUTPUT
rm -f diktat.log
echo "exit-code=${exit_code}" >>$GITHUB_OUTPUT
env:
Expand Down

0 comments on commit 7e985b1

Please sign in to comment.