mirror of
https://github.com/appleboy/ssh-action.git
synced 2026-03-19 19:30:18 +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
1 changed files with 1 additions and 1 deletions
|
|
@ -73,7 +73,7 @@ echo "======================================="
|
||||||
if [[ "${INPUT_CAPTURE_STDOUT}" == 'true' ]]; then
|
if [[ "${INPUT_CAPTURE_STDOUT}" == 'true' ]]; then
|
||||||
{
|
{
|
||||||
echo 'stdout<<EOF'
|
echo 'stdout<<EOF'
|
||||||
"${TARGET}" "$@" | tee -a "${GITHUB_OUTPUT}"
|
"${TARGET}" "$@" | tee /dev/stderr
|
||||||
echo 'EOF'
|
echo 'EOF'
|
||||||
} >>"${GITHUB_OUTPUT}"
|
} >>"${GITHUB_OUTPUT}"
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue