Skip to content

Commit 79d1108

Browse files
committed
fix ci file
1 parent 8cfdb04 commit 79d1108

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/pr-java-ci.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,22 @@ jobs:
4141
if: steps.build.outputs.exit_code != '0'
4242
run: |
4343
author="@${{ github.event.pull_request.user.login }}"
44-
errors=$(awk '
45-
/\[INFO\] Starting audit/ { in=1; next }
46-
/Audit done/ { in=0 }
47-
in && /^Error:/ { print }
48-
' build_output.txt)
44+
errors=""
45+
in_block=0
46+
47+
while IFS= read -r line; do
48+
if [[ "$line" == *"[INFO] Starting audit"* ]]; then
49+
in_block=1
50+
continue
51+
fi
52+
if [[ "$line" == *"Audit done."* ]]; then
53+
in_block=0
54+
continue
55+
fi
56+
if [[ $in_block -eq 1 && "$line" == Error:* ]]; then
57+
errors+="$line"$'\n'
58+
fi
59+
done < build_output.txt
4960
5061
if [ -n "$errors" ]; then
5162
{

0 commit comments

Comments
 (0)