Merge f39ff007253f7a61459ecbd0878d6ab14a8ca84d into c4f70287fc37c43b14b30b407224bbbc8e8c6327

This commit is contained in:
MikeeI 2026-08-17 17:10:38 +08:00 committed by GitHub
commit 8f754ac2dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -109,8 +109,17 @@ fi
echo "======================================="
if [[ "${INPUT_CAPTURE_STDOUT}" == 'true' ]]; then
echo 'stdout<<EOF' >> "${GITHUB_OUTPUT}"
"${TARGET}" "$@" | tee -a "${GITHUB_OUTPUT}"
if "${TARGET}" "$@" | tee -a "${GITHUB_OUTPUT}"; then
capture_status=0
else
capture_status=$?
fi
output_last_byte_newline_count="$(tail -c 1 "${GITHUB_OUTPUT}" | wc -l)"
if [[ "${output_last_byte_newline_count}" -eq 0 ]]; then
echo >> "${GITHUB_OUTPUT}"
fi
echo 'EOF' >> "${GITHUB_OUTPUT}"
exit "${capture_status}"
else
"${TARGET}" "$@"
fi