From 1fd923c4697021dcc8d5221c2e5d8f5599f5f2dd Mon Sep 17 00:00:00 2001 From: "Tomachi [ICHIGO]" Date: Tue, 25 Jan 2022 05:23:28 +0900 Subject: [PATCH] ci: fix count process --- .github/workflows/check-system-print.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-system-print.yml b/.github/workflows/check-system-print.yml index b654c6e87..60b3e9b81 100644 --- a/.github/workflows/check-system-print.yml +++ b/.github/workflows/check-system-print.yml @@ -1,6 +1,6 @@ name: Check using System.out/err.print -on: [ push, pull_request_target ] +on: [ pull_request_target ] jobs: check-system-print: @@ -15,9 +15,10 @@ jobs: - name: Check using System.out.print run: | - COUNT=`grep -rE "System\.(out|err)\.print" --include=*.java src/main > ../system-prints.txt || true` - cat ../system-prints.txt | reviewdog -efm="%f:%l" -name="Check using System.out/err.print" -reporter=github-pr-review -level=warning + COUNT=`grep -rE "System\.(out|err)\.print" --include=*.java src/main | tee ../system-prints.txt | wc -l || true` + echo count: $COUNT cat ../system-prints.txt + cat ../system-prints.txt | reviewdog -efm="%f:%l" -name="Check using System.out/err.print" -reporter=github-pr-review -level=warning if [ "$COUNT" != "0" ]; then echo "Found System.out/err.print in Java source files" exit 1