Skip to content

Commit edef877

Browse files
committed
update
1 parent 5fe9822 commit edef877

1 file changed

Lines changed: 12 additions & 18 deletions

File tree

actions/taskfile-runner/action.yml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -206,33 +206,27 @@ runs:
206206
set -euo pipefail
207207
208208
LIMIT=200
209-
OUT_STR="${{ steps.run.outputs.output }}"
210-
211-
set -f
212-
IFS=$'\n' read -r -d '' -a LINES <<< "${OUT_STR}"$'\0'
213-
set +f
214-
215-
TOTAL="${#LINES[@]}"
216-
MAX="$LIMIT"; if (( TOTAL < LIMIT )); then MAX="$TOTAL"; fi
209+
OUT="${{ steps.run.outputs.output }}"
217210
218211
{
219212
echo "## 🧰 Task Runner Summary"
220213
echo "- Command: \`${{ inputs.command }}\`"
221214
echo "- Directory: \`${{ inputs.dir }}\`"
222215
echo "- Task version: \`${{ steps.install.outputs.version }}\`"
223216
224-
if (( TOTAL > 0 )); then
225-
echo ""
226-
if (( TOTAL <= LIMIT )); then
217+
if [ -n "${OUT}" ]; then
218+
echo ""
219+
220+
TOTAL=$(printf "%s\n" "$OUT" | wc -l | awk '{print $1}')
221+
if [ "$TOTAL" -le "$LIMIT" ]; then
227222
echo "### 🧾 Task output"
228223
else
229224
echo "### 🧾 Task output (first ${LIMIT} lines of ${TOTAL})"
230225
fi
231-
echo '```'
232-
for ((i=0; i<MAX; i++)); do
233-
printf '%s\n' "${LINES[i]}"
234-
done
235-
echo '```'
236-
fi
237-
} >> "$GITHUB_STEP_SUMMARY"
226+
227+
echo '```'
228+
printf "%s\n" "$OUT" | awk -v lim="$LIMIT" 'NR<=lim{print}'
229+
echo '```'
230+
fi
231+
} >> "$GITHUB_STEP_SUMMARY"
238232

0 commit comments

Comments
 (0)