mirror of
https://github.com/appleboy/ssh-action.git
synced 2026-08-22 08:22:55 +00:00
fix(output): randomize captured output delimiter
A standalone EOF line is valid remote stdout, but the runner interprets it as the end of the captured multiline value. Generate one Bash-only randomized delimiter per capture and use it for both framing lines while preserving the streaming tee pipeline and its failure behavior.
This commit is contained in:
parent
b838bc2f27
commit
d3b63444cd
@ -71,9 +71,10 @@ if ! "${TARGET}" --version; then
|
|||||||
fi
|
fi
|
||||||
echo "======================================="
|
echo "======================================="
|
||||||
if [[ "${INPUT_CAPTURE_STDOUT}" == 'true' ]]; then
|
if [[ "${INPUT_CAPTURE_STDOUT}" == 'true' ]]; then
|
||||||
echo 'stdout<<EOF' >> "${GITHUB_OUTPUT}"
|
OUTPUT_DELIMITER="EOF_${RANDOM}_${RANDOM}_${RANDOM}_${RANDOM}_${RANDOM}_${RANDOM}_${RANDOM}_${RANDOM}"
|
||||||
|
echo "stdout<<${OUTPUT_DELIMITER}" >> "${GITHUB_OUTPUT}"
|
||||||
"${TARGET}" "$@" | tee -a "${GITHUB_OUTPUT}"
|
"${TARGET}" "$@" | tee -a "${GITHUB_OUTPUT}"
|
||||||
echo 'EOF' >> "${GITHUB_OUTPUT}"
|
echo "${OUTPUT_DELIMITER}" >> "${GITHUB_OUTPUT}"
|
||||||
else
|
else
|
||||||
"${TARGET}" "$@"
|
"${TARGET}" "$@"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user