mirror of
https://github.com/appleboy/ssh-action.git
synced 2026-02-23 11:36:23 +08:00
fix: prevent stdout duplication when capture_stdout is enabled
The previous implementation wrote command output to GITHUB_OUTPUT twice:
1. Via `tee -a "${GITHUB_OUTPUT}"` directly
2. Via the subshell redirect `} >>"${GITHUB_OUTPUT}"`
This caused every line of captured output to appear twice.
Fix: Change `tee -a "${GITHUB_OUTPUT}"` to `tee /dev/stderr` so that:
- Real-time output is still visible in the Actions log (via stderr)
- Output is only written once to GITHUB_OUTPUT (via subshell redirect)
This commit is contained in:
parent
23bd972bfc
commit
8a62c6ad2e
@ -73,7 +73,7 @@ echo "======================================="
|
||||
if [[ "${INPUT_CAPTURE_STDOUT}" == 'true' ]]; then
|
||||
{
|
||||
echo 'stdout<<EOF'
|
||||
"${TARGET}" "$@" | tee -a "${GITHUB_OUTPUT}"
|
||||
"${TARGET}" "$@" | tee /dev/stderr
|
||||
echo 'EOF'
|
||||
} >>"${GITHUB_OUTPUT}"
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user