Skip to content

Commit

Permalink
improve knip diff output
Browse files Browse the repository at this point in the history
  • Loading branch information
rikukissa committed Jan 3, 2025
1 parent 65abcd5 commit 6a54760
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ jobs:
- name: Run knip on base branch
id: knip_base
run: |
npx knip --tags=-knipignore --no-exit-code --exports --reporter=markdown > knip_report.md
npx knip --tags=-knipignore --no-exit-code --exports --reporter=markdown | sed -E 's/ +/ /g' | sed -E 's/:[0-9]+:[0-9]+//' > knip_report.md
TOTAL=$(grep -oP '## [A-Za-z\s]+ \(\K[0-9]+' knip_report.md | awk '{sum+=$1} END {print sum}')
echo "Total $TOTAL issue(s) on base branch."
echo "total=${TOTAL}" >> $GITHUB_OUTPUT
Expand All @@ -192,7 +192,7 @@ jobs:
- name: Run knip on PR branch
id: knip_pr
run: |
npx knip --tags=-knipignore --no-exit-code --exports --reporter=markdown > knip_report.md
npx knip --tags=-knipignore --no-exit-code --exports --reporter=markdown | sed -E 's/ +/ /g' | sed -E 's/:[0-9]+:[0-9]+//' > knip_report.md
TOTAL=$(grep -oP '## [A-Za-z\s]+ \(\K[0-9]+' knip_report.md | awk '{sum+=$1} END {print sum}')
echo "Total $TOTAL issue(s) on PR branch."
echo "total=${TOTAL}" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 6a54760

Please sign in to comment.