This commit is contained in:
Jesse 2024-09-22 09:42:24 +08:00 committed by GitHub
commit 2c058cad91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View File

@ -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:

View File

@ -63,7 +63,15 @@ TARGET="${GITHUB_ACTION_PATH}/${CLIENT_BINARY}"
echo "Will download ${CLIENT_BINARY} from ${DOWNLOAD_URL_PREFIX}"
curl -fsSL --retry 5 --keepalive-time 2 "${DOWNLOAD_URL_PREFIX}/${CLIENT_BINARY}" -o ${TARGET}
chmod +x ${TARGET}
echo "======= CLI Version ======="
sh -c "${TARGET} --version" # print version
echo "==========================="
{
sh -c "${TARGET} $*" # run the command
} 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