diff --git a/action.yml b/action.yml index 4a16472..26cdc45 100644 --- a/action.yml +++ b/action.yml @@ -73,6 +73,12 @@ inputs: request_pty: description: "Request a pseudo-terminal from the server." +outputs: + stdout: + description: 'Standard output of the executed commands.' + stderr: + description: 'Standard error of the executed commands.' + runs: using: "composite" steps: diff --git a/entrypoint.sh b/entrypoint.sh index f50d56e..6d7e1db 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -63,4 +63,12 @@ TARGET="${GITHUB_ACTION_PATH}/${CLIENT_BINARY}" echo "Will download ${CLIENT_BINARY} from ${DOWNLOAD_URL_PREFIX}" curl -fL --retry 3 --keepalive-time 2 "${DOWNLOAD_URL_PREFIX}/${CLIENT_BINARY}" -o ${TARGET} chmod +x ${TARGET} -sh -c "${TARGET} $*" + +{ + sh -c "${TARGET} $*" +} 2> /tmp/errFile | tee /tmp/outFile + +stdout=$(cat /tmp/outFile) +stderr=$(cat /tmp/errFile) +echo "stdout=${stdout//$'\n'/\\n}" >> $GITHUB_OUTPUT +echo "stderr=${stderr//$'\n'/\\n}" >> $GITHUB_OUTPUT)