mirror of
https://github.com/appleboy/ssh-action.git
synced 2025-03-28 14:46:19 +01:00
use env
This commit is contained in:
parent
765833ffce
commit
1a1adf6ba5
2 changed files with 7 additions and 5 deletions
|
@ -136,6 +136,8 @@ runs:
|
||||||
INPUT_PROXY_USE_INSECURE_CIPHER: ${{ inputs.proxy_use_insecure_cipher }}
|
INPUT_PROXY_USE_INSECURE_CIPHER: ${{ inputs.proxy_use_insecure_cipher }}
|
||||||
INPUT_PROXY_CIPHER: ${{ inputs.proxy_cipher }}
|
INPUT_PROXY_CIPHER: ${{ inputs.proxy_cipher }}
|
||||||
INPUT_SYNC: ${{ inputs.sync }}
|
INPUT_SYNC: ${{ inputs.sync }}
|
||||||
|
INPUT_CAPTURE_STDOUT: ${{ inputs.capture_stdout }}
|
||||||
|
INPUT_CAPTURE_STDERR: ${{ inputs.capture_stderr }}
|
||||||
|
|
||||||
branding:
|
branding:
|
||||||
icon: "terminal"
|
icon: "terminal"
|
||||||
|
|
|
@ -68,13 +68,13 @@ chmod +x ${TARGET}
|
||||||
echo "======= CLI Version ======="
|
echo "======= CLI Version ======="
|
||||||
sh -c "${TARGET} --version" # print version
|
sh -c "${TARGET} --version" # print version
|
||||||
echo "==========================="
|
echo "==========================="
|
||||||
if [ "${{ inputs.capture_stdout }}" == 'true' ] || [ "${{ inputs.capture_stderr }}" == 'true' ]; then
|
if [ "$INPUT_CAPTURE_STDOUT" == 'true' ] || [ "$INPUT_CAPTURE_STDERR" == 'true' ]; then
|
||||||
_stdout=/dev/stdout
|
_stdout=/dev/stdout
|
||||||
_stderr=/dev/stderr
|
_stderr=/dev/stderr
|
||||||
if [ "${{ inputs.capture_stdout }}" == 'true' ]; then
|
if [ "$INPUT_CAPTURE_STDOUT" == 'true' ]; then
|
||||||
_stdout=/tmp/outFile
|
_stdout=/tmp/outFile
|
||||||
fi
|
fi
|
||||||
if [ "${{ inputs.capture_stderr }}" == 'true' ]; then
|
if [ "$INPUT_CAPTURE_STDERR" == 'true' ]; then
|
||||||
_stderr=/tmp/errFile
|
_stderr=/tmp/errFile
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -82,11 +82,11 @@ if [ "${{ inputs.capture_stdout }}" == 'true' ] || [ "${{ inputs.capture_stderr
|
||||||
sh -c "${TARGET} $*" # run the command
|
sh -c "${TARGET} $*" # run the command
|
||||||
} 2> $_stderr | tee $_stdout
|
} 2> $_stderr | tee $_stdout
|
||||||
|
|
||||||
if [ "${{ inputs.capture_stdout }}" == 'true' ]; then
|
if [ "$INPUT_CAPTURE_STDOUT" == 'true' ]; then
|
||||||
stdout=$(cat $_stdout)
|
stdout=$(cat $_stdout)
|
||||||
echo "stdout=${stdout//$'\n'/\\n}" >> $GITHUB_OUTPUT
|
echo "stdout=${stdout//$'\n'/\\n}" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
if [ "${{ inputs.capture_stderr }}" == 'true' ]; then
|
if [ "$INPUT_CAPTURE_STDERR" == 'true' ]; then
|
||||||
stderr=$(cat $_stderr)
|
stderr=$(cat $_stderr)
|
||||||
echo "stderr=${stderr//$'\n'/\\n}" >> $GITHUB_OUTPUT
|
echo "stderr=${stderr//$'\n'/\\n}" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue