From 1a1adf6ba5e155e6a70309d617fc0e676e60b97f Mon Sep 17 00:00:00 2001 From: GammaGames Date: Mon, 25 Nov 2024 10:29:44 -0700 Subject: [PATCH] use env --- action.yml | 2 ++ entrypoint.sh | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 83deeed..2811a42 100644 --- a/action.yml +++ b/action.yml @@ -136,6 +136,8 @@ runs: INPUT_PROXY_USE_INSECURE_CIPHER: ${{ inputs.proxy_use_insecure_cipher }} INPUT_PROXY_CIPHER: ${{ inputs.proxy_cipher }} INPUT_SYNC: ${{ inputs.sync }} + INPUT_CAPTURE_STDOUT: ${{ inputs.capture_stdout }} + INPUT_CAPTURE_STDERR: ${{ inputs.capture_stderr }} branding: icon: "terminal" diff --git a/entrypoint.sh b/entrypoint.sh index aa72e59..4545c53 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -68,13 +68,13 @@ chmod +x ${TARGET} echo "======= CLI Version =======" sh -c "${TARGET} --version" # print version echo "===========================" -if [ "${{ inputs.capture_stdout }}" == 'true' ] || [ "${{ inputs.capture_stderr }}" == 'true' ]; then +if [ "$INPUT_CAPTURE_STDOUT" == 'true' ] || [ "$INPUT_CAPTURE_STDERR" == 'true' ]; then _stdout=/dev/stdout _stderr=/dev/stderr - if [ "${{ inputs.capture_stdout }}" == 'true' ]; then + if [ "$INPUT_CAPTURE_STDOUT" == 'true' ]; then _stdout=/tmp/outFile fi - if [ "${{ inputs.capture_stderr }}" == 'true' ]; then + if [ "$INPUT_CAPTURE_STDERR" == 'true' ]; then _stderr=/tmp/errFile fi @@ -82,11 +82,11 @@ if [ "${{ inputs.capture_stdout }}" == 'true' ] || [ "${{ inputs.capture_stderr sh -c "${TARGET} $*" # run the command } 2> $_stderr | tee $_stdout - if [ "${{ inputs.capture_stdout }}" == 'true' ]; then + if [ "$INPUT_CAPTURE_STDOUT" == 'true' ]; then stdout=$(cat $_stdout) echo "stdout=${stdout//$'\n'/\\n}" >> $GITHUB_OUTPUT fi - if [ "${{ inputs.capture_stderr }}" == 'true' ]; then + if [ "$INPUT_CAPTURE_STDERR" == 'true' ]; then stderr=$(cat $_stderr) echo "stderr=${stderr//$'\n'/\\n}" >> $GITHUB_OUTPUT fi